YUI recommends YUI 3.

YUI 2 has been deprecated since 2011. This site acts as an archive for files and documentation.

Yahoo! UI Library

Number Utility  2.4.1

Yahoo! UI Library > number > YAHOO.util.Number

Show Private Show Protected

static Class YAHOO.util.Number

The static Number class provides helper functions to deal with data of type Number.



String format ( nData , oConfig )
Takes a native JavaScript Number and formats to string for display to user.
nData <Number> Number.
oConfig <Object} (Optional) Optional configuration values:
prefix {String}
String prepended before each number, like a currency designator "$"
decimalPlaces {Number}
Number of decimal places to round.
decimalSeparator {String}
Decimal separator
thousandsSeparator {String}
Thousands separator
suffix {String>
String appended after each number, like " items" (note the space)
Returns: String
Formatted number for display.

Copyright © 2007 Yahoo! Inc. All rights reserved.