Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

GravCart Adding the comma for price

Solved by Jayesh Gohel View solution

Started by Duc 9 years ago · 3 replies · 911 views
9 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.

9 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
9 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 MarkP, 1 week ago
3 127 3 days ago
Themes & Styling · by TomW, 7 days ago
0 69 7 days ago
Themes & Styling · by themetman, 2 weeks ago
1 162 2 weeks ago
Themes & Styling · by AH, 4 weeks ago
1 278 2 weeks ago
Themes & Styling · by Bruno, 4 years ago
6 1467 2 weeks ago