Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bps conversion to Decimal and Decimal256 #1715

Merged
merged 5 commits into from
Jun 9, 2023

Conversation

shanev
Copy link
Contributor

@shanev shanev commented Jun 7, 2023

Have found a common need to do basis points conversion in financial math. So ideally this should live in the standard lib to prevent conversion errors by contracts.

@shanev shanev changed the title Add bps conversion to Decimal and Decimal256 Add bps conversion to Decimal and Decimal256 Jun 7, 2023
Copy link
Member

@webmaster128 webmaster128 left a comment

Choose a reason for hiding this comment

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

Nice addition. Could you add a CHANGELOG entry in the Unreleased section??

packages/std/src/math/decimal.rs Outdated Show resolved Hide resolved
packages/std/src/math/decimal256.rs Outdated Show resolved Hide resolved
shanev and others added 3 commits June 7, 2023 16:53
Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>
Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>
@shanev shanev requested a review from webmaster128 June 7, 2023 21:32
Copy link
Collaborator

@chipshort chipshort left a comment

Choose a reason for hiding this comment

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

LGTM

@chipshort chipshort merged commit c1b4828 into CosmWasm:main Jun 9, 2023
@webmaster128 webmaster128 mentioned this pull request Jun 13, 2023
2 tasks
yubrew referenced this pull request in public-awesome/core Jun 13, 2023
@shanev shanev deleted the shanev/dec-bps branch June 14, 2023 17:36
@webmaster128
Copy link
Member

Backported and shipped as part of 1.2.7 (#1719)

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.

3 participants