wvmoreira / jquery-numberformatter

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

Zero number formats with empty string #60

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. $.formatNumber(0, { format: "#,###.##" })

What is the expected output?
0

What do you see instead?
empty string

What version of the product are you using? On what operating system?
1.2.3

I have found workaround for now ("#,##0.##"), but I think this is not expected 
behaviour.

Original issue reported on code.google.com by hmely...@gmail.com on 12 Feb 2012 at 8:52

GoogleCodeExporter commented 8 years ago
If you try with
var formatted_zero = $.formatNumber('0.00', {format:"#,###.00", locale:"dk"});
The output is ',00' without a leading zero before the decimal separator.

Original comment by thomaste...@gmail.com on 27 Jul 2012 at 1:23

GoogleCodeExporter commented 8 years ago
I think you are looking for the mask #,##0 or #,##0.## etc. to ensure that 1 
digit is always present before the decimal point in the event it's only a zero 
present.

Original comment by apar...@gmail.com on 18 Oct 2013 at 11:30