This is what I have right now:
$("#number").val(parseFloat($("#number").val()).toFixed(2));
It looks messy to me. I don't think I'm chaining the functions correctly. Do I have to call it for each textbox, or can I create a separate function?
...
Is there a way to format in PHP a number always keeping its sign (+ or -)?
In .NET this will be something like:
string myString = number.ToString("+#;#");
...
my script calculates a number X by dividing two other numbers, A by B.
X=A/B
when i use number_format(A,2) on A before calculating X, i get a very odd number. Actual figures:
1,045.00 / 5 = 0.2
but if i don't use number_format on A before the division, i get the correct answer. Is number_format somehow making A into a non-number?
...