Replies: 1 comment
-
You can take a look at That'll do math with a known fraction, rather than floating point. Here's an example https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/aptos-stdlib/tests/fixedpoint64_tests.move#L77-L82 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Discord user ID
itznisargthakkar
Describe your question in detail.
I have written a contract to provide loans to borrowers based on the RWA staking worth. Now, on the pool creation, I am defining the interest rate at which the borrower needs to repay the loan amount. At the pool creation I am doing the expected amount calculation which is the float value and the interest rate is also the float value. I am providing the option to repay the loan on an EMI basis and for storing the expected EMI I also need the float value. So there any way to store the float value for the calculation purpose? in the Move as Well on the Chain
What error, if any, are you getting?
No response
What have you tried or looked at? Or how can we reproduce the error?
Whenever I do a calculation it will convert the float value to an integer automatically I know the type is an Unsigned Integer itself but need a type to store float values. Can you provide any example of how to store and do calculation on the float values?
Which operating system are you using?
Windows
Which SDK or tool are you using? (if any)
TypeScript SDK
Describe your environment or tooling in detail
No response
Beta Was this translation helpful? Give feedback.
All reactions