Change Currency Docfield Symbol

What’s the best way to change a currency docfields currency symbol? From $ to ₹, USD to INR, for example?

I’m using format_currency and then refreshing the field but I can’t trigger a change in the symbol, when I log the output it shows “₹ 100.00”. I cant find an obvious way to do it in set_df_property which seemed like another logical place to look.

Hi,

Maybe you can get some hints here:

EDIT:

For Example:

frm.set_currency_labels(['total'], 'USD')

OK. So this is part of the solution (and a part I forgotten about, so I glad you pointed me to it) but it’s not changing the symbol, just the label. In the console:

cur_frm.set_currency_labels(["amount_due"], "INR")
image
cur_frm.set_currency_labels(["amount_due"], "USD")
image

The currency symbol remains $ but the label changes.

1 Like

The currency fieldtype can be dynamic based on Options in the field’s meta.

You can create a link field for Currency doctype and set that field’s name as “options” for the field whose symbol you want to change. (See Sales Order doctype for example)

Then you can have the label changed and dependent field refreshed on change of link field.

Yes! That worked. Thank you @snv

1 Like

Hello @tmatteson

Can you please the script that you used to accomplish this?
I need to set the symbol for the currency field (it will be dependent on another selection), so how I can obtain this?

Regards
Bilal

Hello @tmatteson
Can you please help?

Regards
Bilal

I can’t find where I’m doing it in the code that I wrote. I know that I have not been able to change it in a child table at all.

What this thing that worked?

Regards
Bilal

Continued here How to show currency Symbol inside the field

This part of the puzzle helps

Hello;

How I can use set_currency_labels for child table field?

Regards
Bilala

1 Like

frappe.model.set_currency_labels(cdt, cdn, "amount", "USD);

Try this one