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 · 928 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, 2 weeks ago
3 193 2 weeks ago
Themes & Styling · by TomW, 2 weeks ago
0 111 2 weeks ago
Themes & Styling · by themetman, 3 weeks ago
1 206 3 weeks ago
Themes & Styling · by AH, 1 month ago
1 324 3 weeks ago
Themes & Styling · by Bruno, 4 years ago
6 1523 3 weeks ago