Comments (4)
[deleted comment]
from jquery-numberformatter.
I got the same problem.
As a workaround i added an additional option to the format-function, which
indicates,
that the containing value is to be interpreted as a javascript number-value.
if(options.raw != true) {
// now we need to convert it into a number
while (text.indexOf(group)>-1)
text = text.replace(group,'');
var number = new Number(text.replace(dec,".").replace(neg,"-"));
} else {
var number = new Number(text);
}
but this is truely a workaround. I would have expected that if the value is a
valid
number, no textreplacements will be made.
Original comment by [email protected]
on 4 Dec 2009 at 8:57
from jquery-numberformatter.
Your right, shouldn't really be parsing the number before formatting, if you
want to do
that then of course you can via 2 separate calls (parse -> js num -> formatted
text).
I'm going to change things to try and separate parsing and formatting more, for
the
next version.
Original comment by [email protected]
on 4 Feb 2010 at 6:33
- Changed state: Accepted
from jquery-numberformatter.
Fixed for 1.2
now works fine via
$('span').formatNumber({format:"#,##0.00 EUR", locale:"de"});
Original comment by [email protected]
on 29 Apr 2010 at 4:36
- Changed state: Fixed
from jquery-numberformatter.
Related Issues (20)
- I've added "tr" Turkish locale support. HOT 1
- Convertion from Lire to Euro with custom format HOT 2
- Careful with NaN HOT 2
- add italian "it" support HOT 2
- Percent format failed after second blur HOT 1
- force value to zero when non numeric input HOT 1
- add carry is not working HOT 1
- 1,9999 formatted to 1,00 instead of 2,00 HOT 4
- Add Portuguese "pt" support HOT 1
- Formatting breaks after first iteration HOT 2
- Problem formatting a number with 5 digits after the floating point. HOT 1
- rounding issue HOT 1
- How to specify formtting with leading zero HOT 2
- Feature Request: Ordinal Suffixes HOT 3
- Prefixes or suffixes break, when running format() on multiple items HOT 5
- Applying the format more than once results in NaN HOT 1
- 0.00 instead of NaN HOT 2
- Small Numbers get wrong Formating. HOT 2
- Number formatting generally does not work as expected HOT 3
- Lack of pl locale HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery-numberformatter.