new Double()
Represents a baja:Double
in BajaScript.
Augments Number
to be a Baja Double
. ECMAScript only has one numeric
type for Doubles, Floats, Longs and Integers. Therefore, this type
naturally maps to baja:Double
.
Extends
Members
-
<static> DEFAULT :Number
-
Default
Number
instance.Type:
- Number
Methods
-
<static> getNumberFromINumeric()
-
Return a
Number
from a BINumeric.Returns:
- Type
- Number
-
<static> make(num)
-
Make a
Number
.Parameters:
Name Type Description num
Number the number value.
Returns:
- Type
- Number
-
decodeFromString(str)
-
Decode a
Number
from aString
.Parameters:
Name Type Description str
String an encoded
Number
.Returns:
- Type
- Number
-
encodeToString()
-
Encode the
Number
(itself) to aString
.Returns:
- Type
- String
-
equals(obj)
-
Equality test.
Parameters:
Name Type Description obj
Returns:
- Type
- Boolean
-
equivalent(obj)
-
Equivalence test.
Used to compare if two objects have equivalent state, but might not want to
return true for equals since it it has implied semantics for many
operations. The default implementation returns the result ofequals()
.Parameters:
Name Type Description obj
Returns:
- Type
- Boolean
-
getDataTypeSymbol()
-
Return the data type symbol.
Used for encoding this data type (primarily for facets).
Returns:
- Type
- String
-
getIcon()
-
Return the Object's Icon.
Returns:
- Type
- baja.Icon
-
getNumber()
-
Return the
Number
(itself).Returns:
- Type
- Number
-
make(num)
-
Make a
Number
.Parameters:
Name Type Description num
Number the number value.
Returns:
- Type
- Number
-
newCopy()
-
New Copy.
Returns:
- Type
- Number
-
toString( [cx])
-
Return the
String
representation of theDouble
(itself).Parameters:
Name Type Argument Description cx
baja.Facets | Object <optional>
used to specify formatting facets. The
argument can also be an Object Literal.Properties
Name Type Argument Description forceSign
Boolean <optional>
specifying 'true' will concatenate a '+'
to the beginning of the number if positive.precision
Number <optional>
the number of decimal places to show in
the return string. Specifying '0' will also remove the decimal.showSeparators
Boolean <optional>
include separators.
units
baja.Unit <optional>
the baja Unit to apply to the return
string.unitConversion
baja.Enum | Number | String <optional>
the
baja:UnitConversion
enum, an ordinal, or tag.zeroPad
Number <optional>
the minimum number of the whole-number
digits to be displayed, filling in zeroes when necessary.Returns:
returns a Promise if a cx is passed in.