Data Format Bug
Data Format Bug
Hello, i tried Data Format. There is a bug on Euro currency. We do not write €21,345.67, we use €21.345,67. Look at the comma and period. This is not correct on all formatings. I need a number like this: 1.200,00
Please fix this. Thanks much, kai
Please fix this. Thanks much, kai
Re: Data Format Bug
True!
Can this be fixed in the next release?
Can this be fixed in the next release?
Re: Data Format Bug
True, and you can change it by yourself as a workaround until it is fixed.
tl;dr (short instructions)
Best,
Jan
PS: Remember to save your changes before updating AppGini next time
PPS: If I remember right, there is still a problem with input of numeric data for datatypes double, float and decimal. The input-field requires a point "." as decimal separator, not a comma ";". I have found a workaround in one of my German projects a year ago, and I will check if I can provide that hack in one of the next releases of AppGini Helper JavaScript Library.
tl;dr (short instructions)
- Close AppGini
- Insert the following line into C:\Program Files (x86)\AppGini\add-ons\dataFormats.cfg:
Code: Select all
Währung Euro (custom) example: 21.345,67 €); CONCAT(FORMAT(%%FIELD%%, 2, 'de_DE'), ' €')
- Open your project in AppGini, select the new format and re-generate your app
- Close AppGini
- There is a file called "add-ons\dataFormats.cfg" in the AppGini-installation directory.
Mine is C:\Program Files (x86)\AppGini\add-ons\dataFormats.cfg - Backup that file for your own safety.
- Open that file with your code editor
- Insert the following line:
Code: Select all
Währung Euro (custom) example: 21.345,67 €); CONCAT(FORMAT(%%FIELD%%, 2, 'de_DE'), ' €')
- Save the file and close it in your editor
- Open AppGini and load your project
- Select your table and field and open the data-format list.
The new entry should be listed now - Select the entry
- Save your project and generate your app
- Check the field
Best,
Jan
PS: Remember to save your changes before updating AppGini next time
PPS: If I remember right, there is still a problem with input of numeric data for datatypes double, float and decimal. The input-field requires a point "." as decimal separator, not a comma ";". I have found a workaround in one of my German projects a year ago, and I will check if I can provide that hack in one of the next releases of AppGini Helper JavaScript Library.
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: Data Format Bug
Thanks again Jan, It works good.
I changed it personally to this, the Euro-sign in front, thanks for the tip.
NL Euro (custom) example: € 21.345,67); CONCAT('€ ', FORMAT(%%FIELD%%, 2, 'nl_NL'))
The other thing, that the "." is the decimal as input, that's still a problem, that was my next issue to solve/search.
So, if you could put that in the Helper Library, it would be great!
I changed it personally to this, the Euro-sign in front, thanks for the tip.
NL Euro (custom) example: € 21.345,67); CONCAT('€ ', FORMAT(%%FIELD%%, 2, 'nl_NL'))
The other thing, that the "." is the decimal as input, that's still a problem, that was my next issue to solve/search.
So, if you could put that in the Helper Library, it would be great!
Re: Data Format Bug
I need to have a look how I did this last year.
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: Data Format Bug
Hi,
it would have been easy to look at
viewtopic.php?t=1805
and
viewtopic.php?t=1278
Having read this you will see, that you need to take care of the conversion via the hooks files if you change the display on the webpage itself.
it would have been easy to look at
viewtopic.php?t=1805
and
viewtopic.php?t=1278
Having read this you will see, that you need to take care of the conversion via the hooks files if you change the display on the webpage itself.
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.
Re: Data Format Bug
Hello, I have been of the radar for sometime, now getting back and picking it up.
What was the problem with this thing again?
In the latest version of AppGini the info from Jan was applied, but what is the right Data type?
The decimals of my ammounts are not beeing saved, so €20,30 is going to €20,00
What was the problem with this thing again?
In the latest version of AppGini the info from Jan was applied, but what is the right Data type?
The decimals of my ammounts are not beeing saved, so €20,30 is going to €20,00
Re: Data Format Bug
Hi, such a nice thing as AppGini, where everything is made easy, why can it be that this "simple" thing isn't in the package programmed.
I can't figure it out, tried alot of things, but I use AppGini because I'm not a web-developer, I'm just an IT-guy that needs simple DB's to create and use.
I don't want (and have) to spent alot of time in finetuning the configfiles or adding hooks, just to get the currency/decimal right, a thing that is used in half of the world.
Dear AppGini, can you please make a nice feature/solution to get this right, without us doing all things in AppGini config-files of hooks.
I can't figure it out, tried alot of things, but I use AppGini because I'm not a web-developer, I'm just an IT-guy that needs simple DB's to create and use.
I don't want (and have) to spent alot of time in finetuning the configfiles or adding hooks, just to get the currency/decimal right, a thing that is used in half of the world.
Dear AppGini, can you please make a nice feature/solution to get this right, without us doing all things in AppGini config-files of hooks.
Re: Data Format Bug
Hi,
either I read too quick, or you did not tell us: Have you set the correct data type in AppGini? For currency I would suggest decimal (integer can not hold any decimals).
Olaf
either I read too quick, or you did not tell us: Have you set the correct data type in AppGini? For currency I would suggest decimal (integer can not hold any decimals).
Olaf
Some postings I was involved, you might find useful:
SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button; Place a search on details view
SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button; Place a search on details view
- D Oliveira
- AppGini Super Hero
- Posts: 348
- Joined: 2018-03-04 09:30
- Location: David
Re: Data Format Bug
if anyone is using Jan’s solution set the dataFormat.cfg file read-only after modifying it, in case you need to update appgini in the future and they havent addressed this issue, just something to keep in mind =) happy coding
Re: Data Format Bug
Hi Olaf, it is set to Decimal.
@ D Oliveira, Jan's solution is in the newest version of AppGini, but it doesn't seems to work.
@ D Oliveira, Jan's solution is in the newest version of AppGini, but it doesn't seems to work.
Re: Data Format Bug
Hi,
maybe I misunderstand your request,
but if you want to enter a decimal number into the database you need to provide it with a . not a ,
so try 20.30 instead of 20,30.
maybe I misunderstand your request,
but if you want to enter a decimal number into the database you need to provide it with a . not a ,
so try 20.30 instead of 20,30.
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.
Re: Data Format Bug
Hi, that's the problem in Europe, we have a comma (,) as a decimal sign.
So if my users put in an amount, they will saying 1,25 in stead of 1.25 (in text 1 euro and 25 cents)
And maybe it isn't a AppGini thing and it is how MySQL just saves it in de database and that's how it works.
Then my question would be, can AppGini provide a builtin function that does the translation van point to comma.
So if my users put in an amount, they will saying 1,25 in stead of 1.25 (in text 1 euro and 25 cents)
And maybe it isn't a AppGini thing and it is how MySQL just saves it in de database and that's how it works.
Then my question would be, can AppGini provide a builtin function that does the translation van point to comma.
Re: Data Format Bug
Also a funny thing: the original topic was made 5 years ago, so it is definitely time for a nice solution.
Re: Data Format Bug
Ok, I have built a new DB and only an amount field with Decimal datatype and Euro-curreny dataformat (€21.456,78)
If I add a new record then there are different values that are shown:
Input = 10,50 - TableView = 10,00 - DetailView = 10.00 (rounds up and the decimal signs are different)
Input = 10.50 - TableView = 10,50 - DetailView = 10.50 (exact value and the decimal signs are different)
If I add a new record then there are different values that are shown:
Input = 10,50 - TableView = 10,00 - DetailView = 10.00 (rounds up and the decimal signs are different)
Input = 10.50 - TableView = 10,50 - DetailView = 10.50 (exact value and the decimal signs are different)
Re: Data Format Bug
Hi,
just try to add to /hooks/tablename.php -> _before_update function a check for the field and replace all . to , and vice versa. Try something like this
or vice versa
Olaf
just try to add to /hooks/tablename.php -> _before_update function a check for the field and replace all . to , and vice versa. Try something like this
Code: Select all
$your_field_name = number_format($your_field_name,2,",",".");
Code: Select all
$your_field_name = number_format($your_field_name,2,".",",");
Some postings I was involved, you might find useful:
SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button; Place a search on details view
SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button; Place a search on details view