How do I find the place value of a number? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How do I find the place value of a number?

How do I find the place value(hundreds,decimals,ones) of a number using modulus? For instance; var a = parseFloat(prompt("insert a number")), b = a%100, c = c%10; document.write()...

21st May 2017, 2:52 PM
Manik Tafralian
Manik Tafralian - avatar
2 Answers
+ 6
For 1's place: b=a%10 For 10's place: a/=10 b=a%10 For 100's place a/=100 b=a%10 And so forth
21st May 2017, 2:58 PM
Pixie
Pixie - avatar
0
what is the slash for ?
21st May 2017, 3:49 PM
Manik Tafralian
Manik Tafralian - avatar