Skip to content

Fix NumDigits with ensureInitialized#301

Merged
mwoss merged 1 commit intoshopspring:masterfrom
zlasd:master
Dec 31, 2023
Merged

Fix NumDigits with ensureInitialized#301
mwoss merged 1 commit intoshopspring:masterfrom
zlasd:master

Conversation

@zlasd
Copy link
Copy Markdown
Contributor

@zlasd zlasd commented Nov 24, 2022

Fix #292

The library promises

The zero-value is 0, and is safe to use without initialization

Simply add ensureInitialized at the beginning of NumDigits to ensure zero-value act as NewFromInt(0).

Copy link
Copy Markdown
Member

@mwoss mwoss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late review! :< Thanks for this fix, I completely forgot about it while implementing this helper function.
LGTM!

@mwoss mwoss merged commit 1df8fb3 into shopspring:master Dec 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] (decimal.Decimal{}).NumDigits == 5

3 participants