i would like to format decimal values to specific format as like 1.23 should be shown as 0001.23 using javascript. is there any specific functions like toPrecision(), tofixed() in javascript to handle these kind of formatting or any pointers to go ahead with any solutions? here preceeding decimal is dynamic one. for example : i have 2 values : first value : 99.4545 second value : 100.32 in this second value has higher length (3)before decimal and first value has higher length after decimal(4). so subtracted result(0.8655) of this should be formatted as ###.#### (000.8685)
thank you