mirror of
https://github.com/MikeMcl/decimal.js.git
synced 2024-10-27 20:34:12 +00:00
Fix typo. Add serialization feature.
This commit is contained in:
parent
131ff3a71b
commit
05e698aba6
@ -10,6 +10,7 @@ An arbitrary-precision Decimal type for JavaScript.
|
|||||||
- Simple but full-featured API
|
- Simple but full-featured API
|
||||||
- Replicates many of the methods of JavaScript's `Number.prototype` and `Math` objects
|
- Replicates many of the methods of JavaScript's `Number.prototype` and `Math` objects
|
||||||
- Also handles hexadecimal, binary and octal values
|
- Also handles hexadecimal, binary and octal values
|
||||||
|
- Supports serialization of Decimals to a compact base-88 format for transmission or persistence
|
||||||
- Faster, smaller, and perhaps easier to use than JavaScript versions of Java's BigDecimal
|
- Faster, smaller, and perhaps easier to use than JavaScript versions of Java's BigDecimal
|
||||||
- No dependencies
|
- No dependencies
|
||||||
- Wide platform compatibility: uses JavaScript 1.5 (ECMAScript 3) features only
|
- Wide platform compatibility: uses JavaScript 1.5 (ECMAScript 3) features only
|
||||||
@ -67,7 +68,7 @@ It accepts a value of type number, string or Decimal.
|
|||||||
A value can also be in binary, hexadecimal or octal if the appropriate prefix is included.
|
A value can also be in binary, hexadecimal or octal if the appropriate prefix is included.
|
||||||
|
|
||||||
x = new Decimal('0xff.f') // '255.9375'
|
x = new Decimal('0xff.f') // '255.9375'
|
||||||
y = new Decimal('1b10101100') // '172'
|
y = new Decimal('0b10101100') // '172'
|
||||||
z = x.plus(y) // '427.9375'
|
z = x.plus(y) // '427.9375'
|
||||||
|
|
||||||
z.toBinary() // '0b110101011.1111'
|
z.toBinary() // '0b110101011.1111'
|
||||||
|
Loading…
Reference in New Issue
Block a user