Search code examples
formatdecimalcurrencywhmcs

How to change WHMCS Price Decimal Separator?


I want to use another character instead of a dot or comma ("." & ",") in WHMCS prices, 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.

Thanks a lot


Solution

  • I solved my problem with the help of Brian from WHMCS community. Here's the solution:

    if we take amount as an example. and say we want to change . to * , we would edit the invoicepdf template and change..

    <td align="center">' . $item['amount'] . '</td>
    

    to...

    <td align="center">' . str_replace('.','*',$item['amount']) . '</td>
    

    and then you would do the same with any other priced variables in the template, e.g tax, subtotal, total etc.