How to obtain the real "currency" value from DB (locale)

Hello all

Please a quick question. I am getting ready a new Scheduler task to send a mail with a summary that includes quantities/values of type “currency”. They are shown in the right way we need in the user interface with our “locale” configuration however in the DB for example the 500,00€ that it is shown in the Detail View, it is stored in the table as “500.00”.

Is there any way that after obtaining this value 500.00 in a SQL query in our custom code, I can, somehow, the global $locale variable to apply the configuration we have and be able to use the string “500,00€” in the mail that I am building in this process.

Thanks so much!

Hey,

For a quick and easy one, if you are only using one currency, you may be able to grab the “default_currency_symbol” value from the config file, some info can be seen on using the Config files here: https://docs.suitecrm.com/developer/config/

Otherwise, if you’re using multiple currencies, it might get a little more complex.
You could grab the “currency_id” from the record that you’ve obtained the value from, and compare this to the “currencies” table, grabbing the “symbol” value from it.

I’m not sure if the above would fit into what you’ve built so far, but hopefully it points in the right direction!