You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Thank you for your work on this great package.
I'm displaying floats in the Number element and I would like 1 to display as 1.00.
Since the value is a string, that formatting shouldn't be an issue in JS.
is there a formatting function that I could pass in? format={(value) => value.toFixed(2)}
also would be useful for displaying units format={(value) => `${value}ms`}
Appreciate any advice.
The text was updated successfully, but these errors were encountered:
Hello @andrejhronco . There isn't a format function, and there isn't a configuration value. There is, however, already a value present on the object for controlling this, and you can modify it after the object is created (and before the value is set). See below:
I have my suspicions about floating-point and nobody wanting to take the time to take it into account, and that this is the reason that it is not currently a documented configuration value.
If you'd like to make a good-faith effort in making sure it doesn't cause issues elsewhere in the codebase, or perhaps in accepting a configurable formatting function that doesn't touch the underlying value, then I'd be more than happy to merge a PR to make this configurable.
Hi,
Thank you for your work on this great package.
I'm displaying floats in the Number element and I would like 1 to display as
1.00
.Since the value is a string, that formatting shouldn't be an issue in JS.
is there a formatting function that I could pass in?
format={(value) => value.toFixed(2)}
also would be useful for displaying units
format={(value) => `${value}ms`}
Appreciate any advice.
The text was updated successfully, but these errors were encountered: