I wrote a code , I want that the output contain only no not rest decimal places.please let me know how can I do it in javascript | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

I wrote a code , I want that the output contain only no not rest decimal places.please let me know how can I do it in javascript

https://code.sololearn.com/W4RWocx8u2SQ/?ref=app

27th Jun 2022, 7:38 AM
Sahil Rajpoot
2 Answers
+ 3
try this: document.write(pies.toFixed(0)); 0 means you want you want 0 numbers after the decimal point, and it rounds the number to how many numbers you want.
27th Jun 2022, 7:41 AM
Мартин 😑🎵
Мартин 😑🎵 - avatar
27th Jun 2022, 7:43 AM
Sahil Rajpoot