1

325.234 to string?

is it toString()?

4 Answers 4

5

Simplest way, concatenate it with an empty string:

325.234 + '';

Which will implicitly call toString() on the number.

You could also use:

String(325.234);

And:

325.234.toString();
Sign up to request clarification or add additional context in comments.

Comments

1

Sure, why not just:

325.234.toString()

Comments

1

or String(325.234)

Comments

1
var number = 123.54
var string = number.toString();

The "toString()" method is called implicitly when you use a non-string as part of a string concatenation. Such as:

var newString = "Hello " + number;

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.