Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/decimal128.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ export class Decimal128 {
lastDigit = nDigitsStored - 1;
significantDigits = nDigits;
if (significantDigits !== 1) {
while (representation[firstNonZero + significantDigits - 1] === '0') {
while (digits[firstNonZero + significantDigits - 1] === 0) {
significantDigits = significantDigits - 1;
}
}
Expand Down
2 changes: 2 additions & 0 deletions test/node/decimal128_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -1210,6 +1210,8 @@ describe('Decimal128', function () {
expect(new Decimal128('00').toString()).to.equal('0');
expect(new Decimal128('0.5').toString()).to.equal('0.5');
expect(new Decimal128('-0.5').toString()).to.equal('-0.5');
expect(new Decimal128('-0.0097').toString()).to.equal('-0.0097');
expect(new Decimal128('-0.0011').toString()).to.equal('-0.0011');
expect(new Decimal128('-1e400').toString()).to.equal('-1E+400');
done();
});
Expand Down