AppGini 5.81 number format

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
Moh Youba
Veteran Member
Posts: 102
Joined: 2017-03-12 09:31

AppGini 5.81 number format

Post by Moh Youba » 2019-11-09 12:18

Hello
I am looking for help to get number format like this " 5 000" instead of this "5000"

How to custom these code

Code 1
SELECT `caisse`.`recettes` - `caisse`.`depenses`
FROM `caisse`
WHERE `caisse`.`idcaisse`='%ID%'

Code 2
SELECT
SUM(montant) depenses
FROM
depenses;

Thank you

pböttcher
AppGini Super Hero
AppGini Super Hero
Posts: 628
Joined: 2018-04-01 10:12

Re: AppGini 5.81 number format

Post by pböttcher » 2019-11-09 13:36

Hi,

you can use

replace(format( VALUE ,0),',',' ')

like

SELECT replace(format(`caisse`.`recettes` - `caisse`.`depenses`,0),',',' ') FROM `caisse`
WHERE `caisse`.`idcaisse`='%ID%'

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 264
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: AppGini 5.81 number format

Post by jsetzer » 2019-11-10 00:03

You can try to use MySql number format function with your locale as 3rd parameter:

http://www.mysqltutorial.org/mysql-format-function/

Available locales:
https://dev.mysql.com/doc/refman/5.7/en ... pport.html

Moh Youba
Veteran Member
Posts: 102
Joined: 2017-03-12 09:31

Re: AppGini 5.81 number format

Post by Moh Youba » 2019-11-10 14:45

Hello

Thank you for your help

Regards

Moh Youba
Veteran Member
Posts: 102
Joined: 2017-03-12 09:31

Re: AppGini 5.81 number format

Post by Moh Youba » 2019-11-17 22:18

Hello
I have try many type but still not working for me

SELECT replace(format(`membres`.`montant` * `membres`.`duree`,0),',','')
FROM `membres`
WHERE `membres`.`idmembre`='%ID%'

"montante is set to decimal and "duree" is set to integer (for reference)

Thank you for any help.

Best regards

Post Reply