Javascript Precision to Format Variable to Specified Length

Does anyone know of a way to format variable to specified length? I found javascript function toPrecision is a way to do it but i am having no luck in making it work.


Any help will be appreciated.


Thanks

Discussions have been disabled for this post