Mad Echet
Mad Echet

Reputation: 3881

Support of Number.toString(radix)

I am looking for a list of browsers that support the radix argument in Number.toString() in Javascript. All implement toString, but I can't find whether they all support the radix argument for the toString function on the Number class.

Does anyone know what browsers support the radix argument?

Upvotes: 0

Views: 167

Answers (2)

Bergi
Bergi

Reputation: 664970

According to Thomas Lahn's ECMAScript Support Matrix all engines support this, though some implementations fail at the tests for Range- and TypeErrors (though I think those tests are flawed).

Upvotes: 1

Joshua Dwire
Joshua Dwire

Reputation: 5443

I just tested it in IE6 and IE7, and it works in both, so you should be safe with using it any browser.

Code: alert((2526).toString(16));

JSFiddle: http://jsfiddle.net/jdwire/cX4s3/2/embedded/result/

Also, MSDN doesn't state that the radix parameter is only available in certain versions of IE, and MDN, which normally lists any compatibility issues, doesn't list any.

Upvotes: 1

Related Questions