Changing Decimal point to Decimal comma

Got something cool to share with AppGini users? Feel free to post it here!
Post Reply
User avatar
RonP
Veteran Member
Posts: 240
Joined: 2013-08-27 13:36
Location: Heiloo, The Netherlands
Contact:

Changing Decimal point to Decimal comma

Post by RonP » 2025-01-16 11:42

I've defined DECIMAL type fields. The value that is to be entered should be with a Comma (,) instead of the standard point (.)
So: I want :123,45 but has to be inputed as: 123.45.

Is this to be changed ?

The App settings are:
App settings.jpg
App settings.jpg (92.28 KiB) Viewed 285 times
Ron

User avatar
RonP
Veteran Member
Posts: 240
Joined: 2013-08-27 13:36
Location: Heiloo, The Netherlands
Contact:

Re: Changing Decimal point to Decimal comma

Post by RonP » 2025-01-17 13:49

Hi,
Ithought that I found the solution
At every field definition you can set de Data Format, I set that to a comma setting (The last option)
Then I put a value in the field, the value of course with a comma, no problem
However, after saving the result was... comma became period AND the given value was truncated :cry:
01-Dataformat.jpg
01-Dataformat.jpg (78.33 KiB) Viewed 272 times
02-Input Decimal comma.jpg
02-Input Decimal comma.jpg (27.65 KiB) Viewed 272 times
03-Resuls-truncated.jpg
03-Resuls-truncated.jpg (26.64 KiB) Viewed 272 times
04 MySql Defined.jpg
04 MySql Defined.jpg (13.6 KiB) Viewed 272 times
So, what goes wrong?

User avatar
RonP
Veteran Member
Posts: 240
Joined: 2013-08-27 13:36
Location: Heiloo, The Netherlands
Contact:

Re: Changing Decimal point to Decimal comma

Post by RonP » 2025-01-18 16:08

Hi,
Anyone a solution for a Decimal comma?

Ron

SkayyHH
Veteran Member
Posts: 479
Joined: 2015-04-27 21:18

Re: Changing Decimal point to Decimal comma

Post by SkayyHH » 2025-02-04 21:11

Hi,

you can change the data formats in "dataFormats.cfg" in AppGini\add-ons folder.

User avatar
RonP
Veteran Member
Posts: 240
Joined: 2013-08-27 13:36
Location: Heiloo, The Netherlands
Contact:

Re: Changing Decimal point to Decimal comma

Post by RonP » 2025-02-05 15:54

i SkayyHH ,
Thank you for the reply, however
The field is not a currency field, so I've selected Points for Thousands and Comma for 2 decimals

The value given in the field has to be (I want) with a decimal point instead the wanted decimal comma

SkayyHH
Veteran Member
Posts: 479
Joined: 2015-04-27 21:18

Re: Changing Decimal point to Decimal comma

Post by SkayyHH » 2025-02-07 14:01

Oh, i understand.

Sorry, i can´t help with this. This need to be coded from a professional ;-)

SkayyHH
Veteran Member
Posts: 479
Joined: 2015-04-27 21:18

Re: Changing Decimal point to Decimal comma

Post by SkayyHH » 2025-02-07 14:02

Have you ask chatGPT? It can help with code and know how to place the it.

User avatar
RonP
Veteran Member
Posts: 240
Joined: 2013-08-27 13:36
Location: Heiloo, The Netherlands
Contact:

Re: Changing Decimal point to Decimal comma

Post by RonP » 2025-02-08 09:03

Hi Skayyhh,
Thank you for your reply, however I’m not going to program my self.
If this functionality doesn’t work well then it is up to AppGini to modify
Ron

User avatar
Marcelo Vitoria
Veteran Member
Posts: 87
Joined: 2016-10-11 12:08

Re: Changing Decimal point to Decimal comma

Post by Marcelo Vitoria » 2025-02-08 15:41

Hello Ronp

Add this line to the dataformats.cfg file:

DESCRIPTION IN MENU ( Sample 21.345,67); CONCAT(' ', FORMAT(%%FIELD%%, 2, 'de_DE'))

It solves the problem when displaying the field, but it does not display when the field is being edited.

There may be problems with fields where "Show column sum" is checked, AG sometimes cannot display the field correctly, but I believe it is a bug in AG because it does not occur in all tables.

I hope this helps and good luck.
Marcelo Vitoria
Coding since 1982 ! :geek:
Basic Sinclar - Clipper - Visual Foxpro - VB6 - PHP
AppGini 24.18 - AdminLTE - SPM
https://www.workspaceservices.com.br/eng

User avatar
RonP
Veteran Member
Posts: 240
Joined: 2013-08-27 13:36
Location: Heiloo, The Netherlands
Contact:

Re: Changing Decimal point to Decimal comma

Post by RonP » 2025-02-08 16:00

Hi Marcelo,

Great, it works. Unfraternally not on the Total field, but I can live with that
Thank you

Ron

Post Reply