Package | com.cyntaxic.cyntils |
Class | public class CynNumber |
Inheritance | CynNumber Object |
CynNumber
class contains static functions for
manipulation of numbers.
Method | Defined 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 |
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.
|
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.
|
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.
|
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.
|
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.
|
Number — The lowest number.
|