Hello,
This seems to be very common question, but my problem hasn't been addressed anywhere.
My code look like
Now the code works absolutely fine if B is 1.2345.It gets changed to 1.23 (2 digits, hunky dory)
problem starts if B is 1 , I need to display 1.00 instead of 1 as i am assigning this variable A value to some textbox and just for the sake of consistency we need to show every thing upto two decimal places.
I have googled for 2 hours and everyone shows how to round a complex decimal number to 2 decimal points but i haven't come across any webpage showing the solution for my problem.
Any help will be appreciated.
Jay
This seems to be very common question, but my problem hasn't been addressed anywhere.
My code look like
Code:
var A = Math.round(B * Math.pow(10,2))/Math.pow(10,2);
problem starts if B is 1 , I need to display 1.00 instead of 1 as i am assigning this variable A value to some textbox and just for the sake of consistency we need to show every thing upto two decimal places.
I have googled for 2 hours and everyone shows how to round a complex decimal number to 2 decimal points but i haven't come across any webpage showing the solution for my problem.
Any help will be appreciated.
Jay
Comment