Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Themes & Styling

GravCart Adding the comma for price

Solved by Jayesh Gohel View solution

Started by Duc 8 years ago · 3 replies · 596 views
8 years ago

How can I change the pricing to include ' , ' My currency is in yen. I would like to show it as 4,000,000 or 4,000

The script is omitting ' , ' whenever I type in the price.

8 years ago Solution

You can use the number_format Twig filter, as -

TWIG
{{ 9800.333|number_format }}
last edited 03/07/18 by Jayesh Gohel
8 years ago

Ah. right one. I just needed the thousand separator. so this is all needed. Thanks.

TWIG
{{ 9800.333|number_format }}
👍 1

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by Pedro M, 2 months ago
4 193 2 months ago
Themes & Styling · by Ian, 2 months ago
3 91 2 months ago
Themes & Styling · by Norbert, 2 years ago
11 451 3 months ago
Themes & Styling · by Lukáš Findeis, 3 months ago
0 45 3 months ago
Themes & Styling · by Sebadamus, 4 months ago
5 125 3 months ago