jessealama / decimal128

JavaScript userland partial implementation of IEEE 754 Decimal128 decimal floating-point arithmetic
BSD 2-Clause "Simplified" License
19 stars 8 forks source link

Produce exponential (string) representation of numbers #1

Closed jessealama closed 1 year ago

jessealama commented 1 year ago

As it stands, the toString method in the Decimal128class produces a complete "read out" of each digit of a number. Please add a new method that allows one to get a string representation of a Decimal128 value in exponential format.

Examples that should work: