apps
apps copied to clipboard
Display and edit of fixed point numbers
It would be really helpful to be able to view fixed point numbers (and edit them) with the actual numbers they represent. Are you open to adding additional common substrate primitives to the ui?
Hey @blakebyrnes Could you please give more context?
Thanks
@piggydoughnut, FixedU128, FixedU64, etc represent decimal numbers using fixed points, but when you edit them in extrinsic creations (or view them in the storage), they show up as full u128 values. For instance, these are prices from the Argon Testnet (Storage -> priceIndex -> current())
{
btcUsdPrice: 65,926,754,199,999,998,853,120
argonUsdPrice: 1,000,000,000,000,000,000
argonUsdTargetPrice: 1,002,545,194,941,447,002
tick: 8,182
}
The BTC usd price is 65,926.754.... In an ideal world, the decimal place would be visible here. And while editing, you would be able to input a variable with optional decimal precision. Below is what fixed numbers show in the extrinsic ui. As you can see, if you're just hoping to enter a percentage, this can make the it very hard to know what to input.
This is not something I would try and implement because of the coupling between the on chain information and how apps interprets that data and sends out any extrinsic, etc.
It's a bit of a PITA - that being said I will keep this open in the case that anyone wants to tackle it.
In general, Inputs generally be provided in Planck units in Polkadot Explorer. However, if an input requires non-Planck units, we are explicity telling users about it with https://github.com/polkadot-js/apps/pull/11275
Hence, Closing this issue as it appears to be outdated now. If the problem persists, a new issue can be opened with updated details.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.