stateful entrypoint getAMBCurrentCount() : int =
8 / 10 * 1000
I’m going to get 0. How do I represent that?
stateful entrypoint getAMBCurrentCount() : int =
8 / 10 * 1000
I’m going to get 0. How do I represent that?
you could implement a decimals type and create math functions for it. Alternatively maybe use bigger numbers, e.g. with 18 decimal 0 as usual in blockchain.
Is there an example where I want to get 80% of a number how do I write it?
So as @philipp.chain explains you got two alternatives:
(X * 80) / 100
and you don’t need to worry about the result being the result of integer division.Ok, I see,think you