1

I am using c# string.Format(format,value) function but I want to achieve this in javascript which I would like to give me the same result which c# give me. Below is the example in c# :

string.Format (62.505152, {0:0.0}) this will return me 62.5

string.Format (62.505152, {0:0.00}) this will return me 62.51

string.Format (62.505152, {0:0.1%}) this will return me 62511%

How can I achieve above examples in javascript which should give me the same return results?

HardCode
  • 6,497
  • 4
  • 31
  • 54
atif khan
  • 51
  • 1
  • 1
  • 6
  • Does this answer your question? [Format number to always show 2 decimal places](https://stackoverflow.com/questions/6134039/format-number-to-always-show-2-decimal-places) – Jeanot Zubler Aug 22 '22 at 13:58

0 Answers0