in Javascript, the toFixed() method formats a number to use a specified number of trailing decimals.
Here is toFixed method in javascript
How can i write a same method in c#?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use the various String.Format() patterns.
For example:
Would produce 20.00. (2 decimal places because N2 was specified).
Standard Numeric Format Strings gives a lot of information on the various format strings for numbers, along with some examples.