Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
182
rated 0 times [  184] [ 2]  / answers: 1 / hits: 49404  / 12 Years ago, tue, july 17, 2012, 12:00:00

I've got this number as a integer 439980



and I'd like to place a decimal place in 2 places from the right. to make it 4399.80



the number of characters can change any time, so i always need it to be 2 decimal places from the right.



how would I go about this?



thanks


More From » formatting

 Answers
24
function insertDecimal(num) {
return (num / 100).toFixed(2);
}

[#84205] Monday, July 16, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kentrelle

Total Points: 333
Total Questions: 93
Total Answers: 95

Location: Vietnam
Member since Sun, Oct 18, 2020
4 Years ago
kentrelle questions
;