Back
I have a string, 12345.00, and I would like it to return 12345.0.
I have looked at trim, but it looks like it is only trimming whitespace and slice which I don't see how this would work. Any suggestions?
You can use the substring function to chop/slice/trim off last character in string in JavaScript see the code below:-
var str = "12345.00";str = str.substring(0, str.length - 1);
var str = "12345.00";
str = str.substring(0, str.length - 1);
31k questions
32.8k answers
501 comments
693 users