Hello friends
I need to set the money display mask to the Brazilian default (R$), so I need to add a mask in the dataFormats.cfg that
either as: number_format($num, 2, ',', '.');
resulting for example:
The value at US $ 100,000.50
It would become R$ 100.000,50
How should I proceed? Will it also change the input method of values in the application?
Thank you
Insert a BR (R$) Currency in dataFormats.cfg
- Marcelo Vitoria
- Veteran Member
- Posts: 65
- Joined: 2016-10-11 12:08
Insert a BR (R$) Currency in dataFormats.cfg
Marcelo Vitoria
Coding since 1984 Basic Sinclair!
Clipper Summer´87 - Visual Foxpro - VB6 - PHP
AppGini 24.12 - AdminLTE - SPM
https://www.workspaceservices.com.br
Coding since 1984 Basic Sinclair!
Clipper Summer´87 - Visual Foxpro - VB6 - PHP
AppGini 24.12 - AdminLTE - SPM
https://www.workspaceservices.com.br
Re: Insert a BR (R$) Currency in dataFormats.cfg
Hi,
you can try to add this for the value onlyIt will only change the display in the table-view. In the detail view you need to take care of the conversion and possible calculations via the js hook.
To convert the data back correctly for the database you will need to handle the data in the hooks/<tablename>.php file <tablename>_before_insert and <tablename>_before_update functions.
you can try to add this for the value only
Code: Select all
numberformat 2 decimals; REPLACE(REPLACE(REPLACE(FORMAT(%%FIELD%%, 2), '.', ':'), ',', '.'), ':', ',')
To convert the data back correctly for the database you will need to handle the data in the hooks/<tablename>.php file <tablename>_before_insert and <tablename>_before_update functions.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
- Marcelo Vitoria
- Veteran Member
- Posts: 65
- Joined: 2016-10-11 12:08
Re: Insert a BR (R$) Currency in dataFormats.cfg
Hello pböttcher,
Thanks a lot for the help.
I'll try to implement.
Thanks a lot for the help.
I'll try to implement.
Marcelo Vitoria
Coding since 1984 Basic Sinclair!
Clipper Summer´87 - Visual Foxpro - VB6 - PHP
AppGini 24.12 - AdminLTE - SPM
https://www.workspaceservices.com.br
Coding since 1984 Basic Sinclair!
Clipper Summer´87 - Visual Foxpro - VB6 - PHP
AppGini 24.12 - AdminLTE - SPM
https://www.workspaceservices.com.br