Handling decimals amounts in transactions

+1 vote
Hello, I have problems transferring amounts with decimals of an address to the sendassetfrom method, in my case I must handle a local currency whose value is equivalent to 3000, when making a payment of 10000 with a conversion ratio of 10000/3000 = 3,333333333333333 but the balance in the reciever address only shows me 3.33 and at the time of showing the balance in my custom local currency with the following conversion 3.33 x 3000 = 9990.

The amount in local currency for the address that received does not match the amount sent, because multichain does not reflect the full amount of decimals. How can I do so that Multichain can save the entire number of decimals so that it does not affect my custom conversion.
asked Jan 8, 2020 by amroth23

1 Answer

+1 vote
 
Best answer

When you issue an asset, you can choose the size of the smallest unit – see the units parameter of the issue (and related) APIs. You can't have an infinite number of decimal places but you might want to set units to 0.000001 in your case, for six decimal places.

answered Jan 9, 2020 by MultiChain
selected Jan 13, 2020 by amroth23
The "units" parameter did work, but it only allows me 10 decimals, I need to handle amounts of 20 or more decimals, such as: 3,33333333333333333. What would be the real limit of decimals of the "units" parameter?
...