AnyBaseConverter Class
AnyBaseConverter is an object that will convert numbers to and from a positional notation with a custom alphabet and base.
Methods
Attributes
alphabet
String
The string of characters to use as single-digit numbers. The length of this string determines the base of the result. Each character should be unique within the string or else it will be impossible to correctly convert a string back into a number. Currently, non-BMP characters are not supported.
Default: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~'
Fires event alphabetChange
Fires when the value for the configuration attribute alphabet
is
changed. You can listen for the event using the on
method if you
wish to be notified before the attribute's value has changed, or
using the after
method if you wish to be notified after the
attribute's value has changed.
Parameters:
-
e
EventFacadeAn Event Facade object with the following attribute-specific properties added:
lookup
Object
protected
Used as a reverse lookup for a character index in alphabet.
Fires event lookupChange
Fires when the value for the configuration attribute lookup
is
changed. You can listen for the event using the on
method if you
wish to be notified before the attribute's value has changed, or
using the after
method if you wish to be notified after the
attribute's value has changed.
Parameters:
-
e
EventFacadeAn Event Facade object with the following attribute-specific properties added:
minusSign
String
A single character string to prepend to negative values. This character should not be in the alphabet. Currently, non-BMP characters are not supported.
Default: '-'
Fires event minusSignChange
Fires when the value for the configuration attribute minusSign
is
changed. You can listen for the event using the on
method if you
wish to be notified before the attribute's value has changed, or
using the after
method if you wish to be notified after the
attribute's value has changed.
Parameters:
-
e
EventFacadeAn Event Facade object with the following attribute-specific properties added:
radixPoint
String
A single character string to insert between the integer and fractional parts of the number. This character should not be in the alphabet. Currently, non-BMP characters are not supported.
Default: '.'
Fires event radixPointChange
Fires when the value for the configuration attribute radixPoint
is
changed. You can listen for the event using the on
method if you
wish to be notified before the attribute's value has changed, or
using the after
method if you wish to be notified after the
attribute's value has changed.
Parameters:
-
e
EventFacadeAn Event Facade object with the following attribute-specific properties added: