Hi,
Im in SA want to change to Zar with the R as symbol also in this format: R10 000.00
Kind Regards,
Richard
How to change to my currency?
Re: How to change to my currency?
You can create a custom data format in
https://bigprof.com/appgini/tips-and-tu ... ta-formats
dataFormats.cfg
:https://bigprof.com/appgini/tips-and-tu ... ta-formats
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: How to change to my currency?
Thank you Jsetzer,
I now have another problem, Im using northwind and when i want to add a data format of my currency to the calculated field it says i need to add the data format into the calculated field, what will that look like?
Kind Regards,
Richard
I now have another problem, Im using northwind and when i want to add a data format of my currency to the calculated field it says i need to add the data format into the calculated field, what will that look like?
Kind Regards,
Richard
Re: How to change to my currency?
(1) What is the datatype of your calculated field? Should be float, decimal or any other numeric data type.
Or you can use an alohanumeric type (like varchar or text) and do the formatting in your SQL command. But then values will ve strings and will contain separators and currency symbol as string, not number. This may lead to further casting and string conversion if you need those calculated values later on AS NUMERIC VALUE.
(2) there is a known issue with AppGini overwriting well formatted values in table view by unformatted values. I think AppGini does not apply the configured dataFormat after recalc. That's one reason I avoid using calculated fields but update values using SQL in _init hook or in before/after insert/update hooks.
Or you can use an alohanumeric type (like varchar or text) and do the formatting in your SQL command. But then values will ve strings and will contain separators and currency symbol as string, not number. This may lead to further casting and string conversion if you need those calculated values later on AS NUMERIC VALUE.
(2) there is a known issue with AppGini overwriting well formatted values in table view by unformatted values. I think AppGini does not apply the configured dataFormat after recalc. That's one reason I avoid using calculated fields but update values using SQL in _init hook or in before/after insert/update hooks.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: How to change to my currency?
Hi Jsetzer,
It was as a double type. I changed it to decimal but still doesnt allow me to change this format of the currency im In why can I not have it as a calculated field and then format that field with showing the correct currency?
I dont know how to change it in mysql but also dont really feel i should do it as it might cause problems down the road.
I would like to show the total with the currency symbol on at the least but the "R" symbol shouldnt be the new value but only an extra printed character that shows on the frontend and still leave the value calculated just as is as a number value.
It was as a double type. I changed it to decimal but still doesnt allow me to change this format of the currency im In why can I not have it as a calculated field and then format that field with showing the correct currency?
I dont know how to change it in mysql but also dont really feel i should do it as it might cause problems down the road.
I would like to show the total with the currency symbol on at the least but the "R" symbol shouldnt be the new value but only an extra printed character that shows on the frontend and still leave the value calculated just as is as a number value.
Re: How to change to my currency?
There are several different ways which will work. My recommendation in this case:
I assume calculation requires fields from the same table, only.
- copy SQL command from your calculated field
- disable calculated field
- ensure field is readonly
- ensure datatype is numeric
- select the desired data format
- generate app
- reload
- if necessary, rebuild fields
- in hooks/TABLENAME.php create a function which updates the value in the database according to your calculation
- call that function in TABLENAME_after_insert and in TABLENAME_after_update hook
- open a record in detail view and save (update) or create a new record and save (insert). Your function should be executed and record should be updated in database. Calculated result should be up to date now and formatted.
That's it.
I assume calculation requires fields from the same table, only.
- copy SQL command from your calculated field
- disable calculated field
- ensure field is readonly
- ensure datatype is numeric
- select the desired data format
- generate app
- reload
- if necessary, rebuild fields
- in hooks/TABLENAME.php create a function which updates the value in the database according to your calculation
- call that function in TABLENAME_after_insert and in TABLENAME_after_update hook
- open a record in detail view and save (update) or create a new record and save (insert). Your function should be executed and record should be updated in database. Calculated result should be up to date now and formatted.
That's it.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: How to change to my currency?
Hi Tsetzer
Where do i go to access mysql and to make these changes? Where do i insert the formulas on mysql and what formulas or calculations is allowed?
Where do i go to access mysql and to make these changes? Where do i insert the formulas on mysql and what formulas or calculations is allowed?