# Yahoo! UI Library

### DataSource Utility 2.8.0r4

Yahoo! UI Library > datasource > YAHOO.util.Number
Search:
Filters Show Private Show Protected Show Deprecated

## `static` Class YAHOO.util.Number

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

### Methods

#### format

`String format ( nData , oConfig )`
Takes a native JavaScript Number and formats to string for display to user.

Parameters:
  `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)
negativeFormat
  String used as a guide for how to indicate negative numbers. The first '#' character in the string will be replaced by the number. Default '-#'.

Returns: `String`
  Formatted number for display. Note, the following values return as "": null, undefined, NaN, "".

Copyright © 2009 Yahoo! Inc. All rights reserved.