tags:

views:

85

answers:

4

325.234 to string?

is it toString()?

+4  A: 

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();
Oded
+1  A: 

Sure, why not just:

325.234.toString()
Gumbo
+1  A: 

or String(325.234)

virsir
+1  A: 
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;
Sohnee