HcpShadow / jquery-numberformatter

Automatically exported from code.google.com/p/jquery-numberformatter
0 stars 0 forks source link

Feature Request: Ordinal Suffixes #23

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
It would be good if this also provided an option for adding ordinal
suffixes to numbers.

Original issue reported on code.google.com by yomora...@gmail.com on 16 Apr 2010 at 2:23

GoogleCodeExporter commented 8 years ago
Thanks, shall look into it.

Original comment by apar...@gmail.com on 28 Apr 2010 at 6:07

GoogleCodeExporter commented 8 years ago
If I understand correctly you want to simply add some text onto the output 
formatted 
number?

E.g.

1.0 -> 1.0 EUR
or
3 -> 3rd

If so this can currently be done by specifying a custom format such as '0.00 
EUR'

e.g.

$('span').formatNumber({format:'0.00rd'});

Original comment by apar...@gmail.com on 29 Apr 2010 at 5:13

GoogleCodeExporter commented 8 years ago
Hello:

I meant something more 'dynamic' or 'automatic', like this (snippet is in PHP):
http://pastium.org/view/6fc76783ae16afbe46f4bd3b5017d2ce

So, the Jquery-NumberFormatter would add the ordinal suffix according to the 
number
to format. This is cool for cases when an app is fetching numbers via Ajax and 
needs
to add an ordinal suffix to them (ideally, without calling a PHP function; all
contained within Javascript).

The solution you gave on previous post will function only is the number is
hard-coded, since the ordinal suffix is also hard-coded.

Original comment by yomora...@gmail.com on 19 May 2010 at 3:51