-
Notifications
You must be signed in to change notification settings - Fork 966
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added ToQuantity - issue #32 #37
Conversation
public static string ToQuantity(this string input, int quantity) | ||
{ | ||
if (quantity == 1) | ||
return string.Format("{0} {1}", quantity, input); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to call .Singularize
on input, don't we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, so you think "requests".ToQuantity(1)
should return "1 request"
? That's a nice observation. I kinda like this. Will add in.
Thanks for the review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do'h. It turns out there is a bug in Singularize method where calling it on a singular word returns null. Similar bug exists on pluralize where calling pluralize on a plural word returns null or the word postfixed with an s; e.g. men => mens!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This issue should be fixed but #43. I would really appreciate your review.
Added ToQuantity - fixes issue #32
No description provided.