Ui-grid-edit: number format

300 views
Skip to first unread message

Kirliam Maciel Dias

unread,
Aug 11, 2015, 11:06:47 PM8/11/15
to AngularJS
I have an editable grid where one of the columns is number. In Brazil the decimal separator is , not .
Do I need to create a template and use editableCellTemplate? Or there is another solution?
The same grid has another editable number column which is formatted as percentage. I would like the user input was like 70,00 instead of 0,70. The model should hold 0.7, so I need some conversion. Again, the editableCellTemplate is the way to go?
I'm just wondering if I'm not missing anything!

Sander Elias

unread,
Aug 11, 2015, 11:21:57 PM8/11/15
to AngularJS
Hi Kirliam,

Did you load your local I18n file?
I guess your look something like this:

<script src="i18n/angular-locale_br.js"></script>

Regards
Sander Elias

Kirliam Maciel Dias

unread,
Aug 12, 2015, 9:58:29 PM8/12/15
to AngularJS
  Hi. Yes, I did:


  and in the controller:

i18nService.setCurrentLang("pt-br");

Sander Elias

unread,
Aug 13, 2015, 7:52:19 AM8/13/15
to AngularJS
Hi Kirliam,

Id you have loaded the I18n files, the number/valuta filters should work the way you need them. Also, the input should respect your local format.
If not, build a small plunk showcasing the issue, and we will take a look at it.

Regards
Sander

Kirliam Maciel Dias

unread,
Aug 15, 2015, 6:19:39 PM8/15/15
to AngularJS
  Thanks Sander.
  It's working now! I was referencing an older verision of the l18n file.
  I just updated the version and it worked!
Reply all
Reply to author
Forward
0 new messages