- Posts: 9
- Thank you received: 0
Questions about Payment Form extension
number of digits after the decimal sign
- erik
- Topic Author
- Offline
- New Member
-
Less
More
12 years 4 months ago #20314
by erik
number of digits after the decimal sign was created by erik
In the confirmation page the amount 8.90 is shown as 8.9 Is there a way to change this to always have 2 digits after the decimal sign?
In the Netherlands we use a comma as the decimal sign. Can we set this somewhere?
In the Netherlands we use a comma as the decimal sign. Can we set this somewhere?
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
12 years 4 months ago #20415
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: number of digits after the decimal sign
Hi erik
Yes. It is possible. However, you will have to edit the code (right now, the format number is not configurable in the extension). Basically, PHP now uses number_format function to format the number ( php.net/manual/en/function.number-format.php ). So in this case, you will need to search through the code , find number_format function and change it to meet your need.
Hope it gives you some clues !
Tuan
Yes. It is possible. However, you will have to edit the code (right now, the format number is not configurable in the extension). Basically, PHP now uses number_format function to format the number ( php.net/manual/en/function.number-format.php ). So in this case, you will need to search through the code , find number_format function and change it to meet your need.
Hope it gives you some clues !
Tuan
Please Log in or Create an account to join the conversation.
- erik
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 9
- Thank you received: 0
12 years 4 months ago #20446
by erik
Replied by erik on topic Re: number of digits after the decimal sign
Hi Tuan,
Can you be more specific as to where in the code this must be changed? In controller.php I can see the following 2 lines:
$results_arr[]= number_format($r->amount, 2);
$results_arr[]= number_format($r->discount_amount, 2);
changing this to:
$results_arr[]= number_format($r->amount, 2, ',', '.');
$results_arr[]= number_format($r->discount_amount, 2, ',', '.');
did not change the result
also changing the following line:
$results_arr[] = $value ;
into:
$results_arr[] = number_format($value, 2, ',', '.') ;
did not change the result
PHP version is 5.3.17
Can you be more specific as to where in the code this must be changed? In controller.php I can see the following 2 lines:
$results_arr[]= number_format($r->amount, 2);
$results_arr[]= number_format($r->discount_amount, 2);
changing this to:
$results_arr[]= number_format($r->amount, 2, ',', '.');
$results_arr[]= number_format($r->discount_amount, 2, ',', '.');
did not change the result
also changing the following line:
$results_arr[] = $value ;
into:
$results_arr[] = number_format($value, 2, ',', '.') ;
did not change the result
PHP version is 5.3.17
Please Log in or Create an account to join the conversation.
Moderators: Tuan Pham Ngoc
Support
Documentation
Information
Copyright © 2025 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.