Packagecom.cyntaxic.cyntils
Classpublic class CynNumber
InheritanceCynNumber Inheritance Object

The CynNumber class contains static functions for manipulation of numbers.



Public Methods
 MethodDefined By
  
addLeadingZero(number:Number):String
[static] Formats a number to include a leading zero if it is a single digit between -1 and 10.
CynNumber
  
commaFormat(number:Number):String
[static] Returns a comma formatted string from a number.
CynNumber
  
decimalPlaces(number:Number, precision:int):Number
[static] Trims a floating point number to specified number of places.
CynNumber
  
getHighest(numbers:Array):Number
[static] Returns the highest number in an array.
CynNumber
  
getLowest(numbers:Array):Number
[static] Returns the lowest number in an array.
CynNumber
Method Detail
addLeadingZero()method
public static function addLeadingZero(number:Number):String

Formats a number to include a leading zero if it is a single digit between -1 and 10.

Parameters

number:Number — The number that will be formatted.

Returns
String — A string with single digits between -1 and 10 padded with a leading zero.
commaFormat()method 
public static function commaFormat(number:Number):String

Returns a comma formatted string from a number.

Parameters

number:Number — The number to be formatted.

Returns
String — The comma formatted string.
decimalPlaces()method 
public static function decimalPlaces(number:Number, precision:int):Number

Trims a floating point number to specified number of places.

Parameters

number:Number — The number to be converted.
 
precision:int — The decimal precision.

Returns
Number — The decimal number.
getHighest()method 
public static function getHighest(numbers:Array):Number

Returns the highest number in an array.

Parameters

numbers:Array — The array.

Returns
Number — The highest number.
getLowest()method 
public static function getLowest(numbers:Array):Number

Returns the lowest number in an array.

Parameters

numbers:Array — The array.

Returns
Number — The lowest number.