Keen-UI icon indicating copy to clipboard operation
Keen-UI copied to clipboard

How to format ui-textbox number value?

Open madatan opened this issue 6 years ago • 1 comments

Hi, I am using ui-textbox for number input and I need to apply a format, e.g.

for 2000000.23 I want to be displayed as 2,000,000.23

How can I achieve this? I couldn't find any prop for format. Also, I need the binding value to be kept as numeric, because I use it for numeric operations.

Thanks in advance!

madatan avatar Jul 23 '19 12:07 madatan

Hi @madatan,

Unfortunately, UiTextbox doesn't currently support formatting the displayed value.

This would be non-trivial, because, as you mention, we'll need to keep the raw input for the binding while showing a different formatted value.

Would it suit you use-case if you just show the formatted value somewhere next to the textbox?

JosephusPaye avatar Jul 25 '19 10:07 JosephusPaye