Skip to content

How can i calculate "scale"? #446

Answered by sarahdayan
antpv asked this question in Q&A
Oct 17, 2021 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Hey @antpv!

Your rate has seven fraction digits, meaning you can represent as an integer with a scale of 7.

An easy way to get the amount is to then multiply your rate by 10 to the power of the scale (0.0001234 * 10**7), so in your case it would be { amount: 1234, scale: 7 }.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@antpv
Comment options

@sarahdayan
Comment options

@sarahdayan
Comment options

Answer selected by sarahdayan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants