You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. Fill a "lire" input with the value of a "euro" input (two textbox).
2. txtEuro is $("#txtEuro") and txtLire is $("#txtLire")
3. I use this:
function calculateLire(txtEuro, txtLire) {
var euro = $(txtEuro).parse({ locale: "it" });
if (euro == 0) {
$(txtLire).val(0);
}
else {
$(txtLire).val((euro * 1936.27));
// at this point txtLire contain a correct value ("us" formatted)
$(txtLire).format({ format: "#.000", locale: "it" });
}
}
Locale "it" have dec="," , group="." like "de"
What is the expected output? What do you see instead?
with "1" in txtEuro I have 193627,000.
Correct string is 1936,270 .
I also try this trick:
$(txtLire).format({ format: "#.000", locale: "us" });
$(txtLire).format({ format: "#.000", locale: "de" });
but not does what I want...
How can I use this plugin for obtain the right result?
What version of the product are you using? On what operating system?
version 1.1.2 (on Windows XP, Firefox and Maxthon)
Please provide any additional information below.
I think the problem is on format function:
// now we need to convert it into a number
while (text.indexOf(group) > -1)
text = text.replace(group, '');
the number 1936.27 become 193627 here...
bye
Alessandro
Original issue reported on code.google.com by alessandro.piccione.75 on 23 Jun 2009 at 11:05
The text was updated successfully, but these errors were encountered:
I make this change in format function, and it works for me:
/// CHANGE (Alessandro): this code treat string like a formatted
one, but I WANT to format an unformatted one
// 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, "-"));
//while (text.indexOf(group) > -1)
// text = text.replace(group, '');
//var number = new Number(text.replace(dec, ".").replace(neg, "-"));
var number = new Number(text);
Alessandro
Original comment by alessandro.piccione.75 on 23 Jun 2009 at 11:24
Original issue reported on code.google.com by
alessandro.piccione.75
on 23 Jun 2009 at 11:05The text was updated successfully, but these errors were encountered: