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
I have a form where I'm using a field to represent money. Not only would I like to display the bound value to include the relevant currency indicator (e.g. $SOME_VALUE), but I'd also like to collect the input in a scale factor that goes through a conversion prior to being displayed. In my particular the bound value is denominated in cents but the display shows it scaled by a hundred so that it appears to the end user that they are entering data in terms of dollars (so I can easily avoid floating point hassles). I can get the behavior I want with a custom-formatter function on a but I'd like equivalent functionality for number input.
Ideally, I'd also like to keep the number input editable and map a conversion function on the string if the end user were to update the value outside of the Plus and Minus buttons. Worst case though, I'm ok setting the text field as non-editable and relying solely on the step up/down button controls.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a form where I'm using a field to represent money. Not only would I like to display the bound value to include the relevant currency indicator (e.g. $SOME_VALUE), but I'd also like to collect the input in a scale factor that goes through a conversion prior to being displayed. In my particular the bound value is denominated in cents but the display shows it scaled by a hundred so that it appears to the end user that they are entering data in terms of dollars (so I can easily avoid floating point hassles). I can get the behavior I want with a custom-formatter function on a but I'd like equivalent functionality for number input.
Ideally, I'd also like to keep the number input editable and map a conversion function on the string if the end user were to update the value outside of the Plus and Minus buttons. Worst case though, I'm ok setting the text field as non-editable and relying solely on the step up/down button controls.
Beta Was this translation helpful? Give feedback.
All reactions