I’m looking to get the scale and precision from a number in the following example.
var x = 1234.567;
I’m not seeing any .scale or .precision functions built in and I’m not sure what the best way to right one is.
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.
NOTE
Javascript has toPrecision() method that gives to a number with specified length.
For example:
But
and so on.
According to comment
Is there a way to check that the string contain
.?Note
.indexof()return first index of target else-1.