AbanteCart Development > Customization help

Format price number


Hi, can you tell me please how to change the format of price number from example 44,444 to 44 444 or 44 000.00? Thank you

Hello Alicia,

Check this doc:

Also there are some formats in language definition. See attached image

To change the thousand and decimal points format please read this guide https://abantecart.atlassian.net/wiki/spaces/AD/pages/15466660/Language+Definitions#LanguageDefinitions-Example:Changedecimalpointandthousandpointformat

As a complement to previous answers, for those who want adding a space between the price and a currency code, this can be done in 'core\lib\currency.php', at at the end of the 'wrap_display_format' function (~ line 237), this way:

--- Code: --- public function wrap_display_format($number, $currency = ''){
return $symbol_left . $formatted_number .' '. $symbol_right;
--- End code ---

Example case:
1200.00SEK will become 1200.00 SEK.

Edit on 2024/02/27:

And for those who want to strip decimals only for round numbers, here's how you can implement a "price beautifier":


[0] Message Index

Go to full version
Powered by SMFPacks Social Login Mod