javascript - How to round off number at decimal places -


इस सवाल का पहले से ही एक उत्तर है: < / P>

  • 8 जवाब

44571.123 * 75.46 = 3363336.94158, लेकिन मैं मान चाहता हूँ 3363336.942 तो क्या मैं जावा स्क्रिप्ट में कोड लिखू

आप इस तरह से समारोह का उपयोग कर सकते हैं:

< प्री> var sum = (44571.123 * 75.46); Var दशमलव = sum.toFixed (3);

3 के साथ दशमलव स्थानों की संख्या जिसे आप चाहते हैं।


Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -