material-ui-currency-textfield icon indicating copy to clipboard operation
material-ui-currency-textfield copied to clipboard

Option to ALLOW typing decimals

Open felipenmoura opened this issue 4 years ago • 1 comments

This was almost perfect for what I needed...except my client needs to type in the cents and needs that mask to show the separator and cents while users type.

If the user types 12345678 it would (in pt-BR) show while typing: 123.456,78.

Is there any feature or option to make that possible? Thanks.

felipenmoura avatar Feb 23 '21 13:02 felipenmoura

There is an example of how to format by changing the comma to period. When entering the value, however, it is necessary to force typing of the comma to separate cents.


Existe um exemplo de como mudar as formatações nos demos (seção Change in characters) que troca justamente a vírgula por ponto, para uso com R$: decimalCharacter="," digitGroupSeparator="."

Lembrando que é necessário forçar o uso da vírgula , portanto, o valor a ser digitado é 123456,78, caso contrário ele entende como um valor inteiro , com zeros nos centavos.

moisesbaddini avatar Mar 06 '21 01:03 moisesbaddini