If the string "0/5"
is only used for display purposes then you only need to store the two integer components that make up the display value. The you you use those two values to create the "display string" as required.
For example, if this was a user score for a quiz, then your two values are "user score" and "maximum score". Each of which would be stored as an int
in two separate database fields.
Then anytime you need to display it you just recreate the string, for example:
string display = string.Format("{0}/{1}", userScore, maximumScore);
//where totalScore and maximumScore have been pulled from your DB
Of course, in the example of a quiz, you would likely be able to recalculate the "maximum score" from other data anyway (e.g. Number of Questions) so there would only be a need to store the first value, userScore
.
In your example case, just store the value of y
in the database.