Yahoo! UI Library

datatype  3.0.0

Yahoo! UI Library > datatype > DataType.Number
Search:
 
Filters

static Class DataType.Number

DataType.Number provides a set of utility functions to operate against Number objects.

Methods

format

String format ( data , config )
Takes a Number and formats to string for display to user.
Parameters:
data <Number> Number.
config <Object} (Optional) Optional configuration values:
prefix {String}
String prepended before each number, like a currency designator "$"
decimalPlaces {Number}
Number of decimal places to round. Must be a number 0 to 20.
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. Note, the following values return as "": null, undefined, NaN, "".

parse

Number parse ( data )
Converts data to type Number.
Parameters:
data <String | Number | Boolean> Data to convert. The following values return as null: null, undefined, NaN, "".
Returns: Number
A number, or null.


Copyright © 2009 Yahoo! Inc. All rights reserved.