eArmin Posted May 4, 2018 Share Posted May 4, 2018 I want to use another character instead of a dot or comma ("." & ",") in WHMCS, especially in invoices PDFs. Currencies' settings just allow you to choose from 4 predefined formats that are not what I need. Could someone please tell me how to change this character? please also tell me the file names that should be edited, not only a line of code that I don't know where should I insert it. Thank you 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Support Manager WHMCS John Posted May 5, 2018 WHMCS Support Manager Share Posted May 5, 2018 Hi @eArmin, Check out this blog post, you should find it helpful: https://blog.whmcs.com/132057/customise-price-formatting-with-the-price-formatter 0 Quote Link to comment Share on other sites More sharing options...
isixhosting Posted May 25, 2020 Share Posted May 25, 2020 On 5/5/2018 at 2:26 AM, WHMCS John said: Hi @eArmin, Check out this blog post, you should find it helpful: https://blog.whmcs.com/132057/customise-price-formatting-with-the-price-formatter How to change WHMCS Price Decimal Separator? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 26, 2020 Share Posted May 26, 2020 16 hours ago, isixhosting said: How to change WHMCS Price Decimal Separator? from what to what? and where ?? 1 Quote Link to comment Share on other sites More sharing options...
isixhosting Posted May 26, 2020 Share Posted May 26, 2020 14 minutes ago, brian! said: from what to what? and where ?? div class="price"><span>{$product.pricing.minprice.price} {$LANG.orderpaymenttermonetime}</span></div> {else} <div class="package-starting-from ">{$LANG.startingat}</div> <div class="price"> {if $product.pricing.rawpricing.triennially neq -1}<span>{$currency.prefix}{($product.pricing.rawpricing.triennially/36)|string_format:"%.2f"}{$currency.suffix}</span>/mo {elseif $product.pricing.rawpricing.biennially neq -1}<span>{$currency.prefix}{($product.pricing.rawpricing.biennially/24)|string_format:"%.2f"}{$currency.suffix}</span>/mo {elseif $product.pricing.rawpricing.annually neq -1}<span>{$currency.prefix}{($product.pricing.rawpricing.annually/12)|string_format:"%.2f"}{$currency.suffix}</span>/mo {else}{$product.pricing.minprice.cycleText} {/if} </div> Hi Brian, Lagom support said this: "Your customization format the price with "dot", as you are using rawrpice value, which WHMCS format always with "dot". Please fix your customization, to handle the WHMCS currency setting." How can I change the 'rawpricing' thing? Thanks 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 26, 2020 Share Posted May 26, 2020 (edited) Hi @isixhosting 1 hour ago, isixhosting said: How can I change the 'rawpricing' thing? I would suggest switching from using string_format to number_format - that allows you to easily specify decimal and thousand separator characters in the output... <div class="price"> {if $product.pricing.rawpricing.triennially neq -1}<span>{$currency.prefix}{($product.pricing.rawpricing.triennially/36)|number_format:2:',':'.'}{$currency.suffix}</span>/mo {elseif $product.pricing.rawpricing.biennially neq -1}<span>{$currency.prefix}{($product.pricing.rawpricing.biennially/24)|number_format:2:',':'.'}{$currency.suffix}</span>/mo {elseif $product.pricing.rawpricing.annually neq -1}<span>{$currency.prefix}{($product.pricing.rawpricing.annually/12)|number_format:2:',':'.'}{$currency.suffix}</span>/mo {else}{$product.pricing.minprice.cycleText} {/if} </div> in the above example, the number is being formatted to 2 decimal places, decimal separated using a comma (,) and thousand separated using a full stop (.) - though I would imagine if you're dividing prices by at least 12, you won't really need to define the thousands separator. 🙂 Edited May 26, 2020 by brian! 1 Quote Link to comment Share on other sites More sharing options...
isixhosting Posted May 26, 2020 Share Posted May 26, 2020 8 minutes ago, brian! said: I would suggest switching from using string_format to number_format - that allows you to easily specify decimal and thousand separator characters in the output... BRIAN - the best forever!!! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.