Welcome to the nuBuilder Forums!
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
swiss number format
-
- Posts: 30
- Joined: Fri Oct 30, 2020 7:08 pm
swiss number format
How can I create following format: CHF 9’956’000
In the Form it's possible to exchange the $ trough CHF, but how can I change the 1.000 trough 1'000
In the Form it's possible to exchange the $ trough CHF, but how can I change the 1.000 trough 1'000
If you like nuBuilder, please leave a review on SourceForge
-
- nuBuilder Team
- Posts: 508
- Joined: Fri Dec 28, 2018 1:41 pm
- Location: Krakow, Poland
- Has thanked: 11 times
- Been thanked: 18 times
Re: swiss number format
In browse form for example you can use Format:
FORMAT(ofe_cena,2,'rm_CH')
FORMAT(ofe_cena,2,'rm_CH')
You do not have the required permissions to view the files attached to this post.
If you like nuBuilder, please leave a review on SourceForge
-
- Posts: 30
- Joined: Fri Oct 30, 2020 7:08 pm
Re: swiss number format
Thanks for the proposal, but where can I put that Format in?
If you like nuBuilder, please leave a review on SourceForge
-
- nuBuilder Team
- Posts: 508
- Joined: Fri Dec 28, 2018 1:41 pm
- Location: Krakow, Poland
- Has thanked: 11 times
- Been thanked: 18 times
Re: swiss number format
Put it in the
From / Browse / Display field
for example if you have there: ofe_cena
then replace with: FORMAT(ofe_cena,2,'rm_CH')
(this is OK with MariaDB)
From / Browse / Display field
for example if you have there: ofe_cena
then replace with: FORMAT(ofe_cena,2,'rm_CH')
(this is OK with MariaDB)
If you like nuBuilder, please leave a review on SourceForge
-
- nuBuilder Team
- Posts: 4562
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 528 times
- Contact:
Re: swiss number format
BTW, "rm_CH" is the ICU Locale of “Romansh (Switzerland)
You might want to use "de_CH" instead (even though the grouping separator is ' for both of them)
You might want to use "de_CH" instead (even though the grouping separator is ' for both of them)
-
- Posts: 30
- Joined: Fri Oct 30, 2020 7:08 pm
Re: swiss number format
thanks so far and what about the edit part of a form?
how can I set there the right format?
BR Paul
how can I set there the right format?
BR Paul
You do not have the required permissions to view the files attached to this post.
If you like nuBuilder, please leave a review on SourceForge
-
- nuBuilder Team
- Posts: 508
- Joined: Fri Dec 28, 2018 1:41 pm
- Location: Krakow, Poland
- Has thanked: 11 times
- Been thanked: 18 times
Re: swiss number format
Hi,
Please find enclosed short movie how you can add your own format.
https://drive.google.com/file/d/1wzEzVw ... sp=sharing
Please find enclosed short movie how you can add your own format.
https://drive.google.com/file/d/1wzEzVw ... sp=sharing
If you like nuBuilder, please leave a review on SourceForge
-
- Posts: 30
- Joined: Fri Oct 30, 2020 7:08 pm
Re: swiss number format
Perfect, I'll try that and I'm sure it will work. 

If you like nuBuilder, please leave a review on SourceForge
-
- nuBuilder Team
- Posts: 4562
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 528 times
- Contact:
Re: swiss number format
Here's another solution (Advantage: No JavaScript required)
Run this query in your database
Then replace the function nuPunctuation() in nucommon.php with this one:
PS: Other changes will have to be done in nuAddFormatting() to make it work with negative amounts.
Run this query in your database
Code: Select all
INSERT INTO `zzzzsys_format` (`zzzzsys_format_id`, `srm_type`, `srm_format`) VALUES ('5f4759ef6e2cec9', 'Number', 'CHF 1\'000.00');
Code: Select all
function nuPunctuation($f){
$c = '';
$d = '';
if(strpos($f , '1,' ) !== false){
$c = ',';
}
if(strpos($f , '1.' ) !== false){
$c = '.';
}
if(strpos($f , '0,' ) !== false){
$d = ',';
}
if(strpos($f , '0.' ) !== false){
$d = '.';
}
if(strpos($f , '0\'' ) !== false){
$d = '\'';
}
return [$c, $d];
}
-
- Posts: 30
- Joined: Fri Oct 30, 2020 7:08 pm
Re: swiss number format
Thanks for the quick help. It works like a charm on forms and I really appreciate it.
The solution with the new code in function nuPunctuation($f) does not work on reports.
The solution with the new code in function nuPunctuation($f) does not work on reports.
If you like nuBuilder, please leave a review on SourceForge