# Python set locale

**URL:** <https://community.plotly.com/t/python-set-locale/32410>\
**Category:** 📊 Plotly Python\
**Created:** [December 10, 2019, 6:05pm UTC](https://community.plotly.com/t/python-set-locale/32410 "2019-12-10T18:05:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![agsharath](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@agsharath](https://community.plotly.com/u/agsharath)\
**Post date:** [December 10, 2019, 6:05pm UTC](https://community.plotly.com/t/python-set-locale/32410/1 "2019-12-10T18:05:09Z")

</div>

How can I set the localization in plotly python. I want to display y axis as currency in indian format (Rupees Lakhs Crores)

---

<div class="post-metadata">

**Author:** ![Emmanuelle](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/emmanuelle/32/7853_2.png) [@Emmanuelle](https://community.plotly.com/u/Emmanuelle)\
**Post date:** [December 10, 2019, 9:29pm UTC](https://community.plotly.com/t/python-set-locale/32410/2 "2019-12-10T21:29:57Z")

</div>

Hi @agsharath, welcome to the forum!

You can use a ticks prefix or suffix if you want to add symbols, as described here [https://stackoverflow.com/questions/58140143/add-currency-symbol-in-the-y-axis-scale-using-plotly-method-in-python/58142945#58142945](https://stackoverflow.com/questions/58140143/add-currency-symbol-in-the-y-axis-scale-using-plotly-method-in-python/58142945#58142945). If you want to have different symbols, you can use `tickformatstops` as described in [https://plot.ly/python/tick-formatting/#tickformatstops-to-customize-for-different-zoom-levels](https://plot.ly/python/tick-formatting/#tickformatstops-to-customize-for-different-zoom-levels).

---

<div class="post-metadata">

**Author:** ![Emmanuelle](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/emmanuelle/32/7853_2.png) [@Emmanuelle](https://community.plotly.com/u/Emmanuelle)\
**Post date:** [December 10, 2019, 9:31pm UTC](https://community.plotly.com/t/python-set-locale/32410/3 "2019-12-10T21:31:18Z")

</div>

Also see [https://plot.ly/python/axes/#enumerated-ticks-with-tickvals-and-ticktext](https://plot.ly/python/axes/#enumerated-ticks-with-tickvals-and-ticktext) for the use of `tickprefix`.

---

<div class="post-metadata">

**Author:** ![agsharath](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@agsharath](https://community.plotly.com/u/agsharath)\
**Post date:** [December 11, 2019, 3:31am UTC](https://community.plotly.com/t/python-set-locale/32410/4 "2019-12-11T03:31:05Z")

</div>

Thanks, I did read about these, but there is much more to formatting currency than tick prefixes, for example, grouping separators, grouping symbols, units (in India we use Lakhs and Crores, not millions and billions) So I’m surprised that plotly doesn’t support full Locale customizations. Anyway I’ll use what you mentioned. Thanks!

---

<div class="post-metadata">

**Author:** ![Emmanuelle](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/emmanuelle/32/7853_2.png) [@Emmanuelle](https://community.plotly.com/u/Emmanuelle)\
**Post date:** [December 11, 2019, 3:34am UTC](https://community.plotly.com/t/python-set-locale/32410/5 "2019-12-11T03:34:18Z")

</div>

Don’t hesitate to post here screenshots (possibly obtained with other software) so that we can get an idea of what is missing. Thanks!

---

<div class="post-metadata">

**Author:** ![agsharath](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@agsharath](https://community.plotly.com/u/agsharath)\
**Post date:** [December 11, 2019, 3:08pm UTC](https://community.plotly.com/t/python-set-locale/32410/6 "2019-12-11T15:08:34Z")

</div>

In India, the number system is formatted like this

1 (One)  
10 (Ten)  
100 (Hundred)  
1,000 (Thousand)  
10,000 (Ten Thousand)  
1,00,000 (One Lakh)  
10,00,000 (Ten Lakhs)  
1,00,00,000 (One Crore)  
10,00,00,000 (Ten Crores)  
1,00,00,00,000 (Hundred Crores)  
10,00,00,00,000 (Thousand Crores)  
1,00,00,00,00,000 (Ten Thousand Crores)  
10,00,00,00,00,000 (One Lakh Crore)

and it goes on.

The grouping is 2 except at the beginning. Thousand is written as 1,000

There is a symbol for rupee (the unit of currency) [https://en.wikipedia.org/wiki/Indian\_rupee\_sign](https://en.wikipedia.org/wiki/Indian_rupee_sign)

Furthermore, the suffix for unit is different.

For thousands, it is ok to use K for example 10,000 is 10K

but for lakhs, we use L

For example 10,00,000 (Ten lakhs) would be 10L

Crores is abbreviated as C or Cr

So 10,00,00,000 (ten crores) would be 10 Cr or 10 C

Thanks

Sharath

---

<div class="post-metadata">

**Author:** ![agsharath](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@agsharath](https://community.plotly.com/u/agsharath)\
**Post date:** [December 11, 2019, 3:13pm UTC](https://community.plotly.com/t/python-set-locale/32410/7 "2019-12-11T15:13:29Z")

</div>

It would be great if I could define a function which would accept a number value and return the desired label as string (for the axes)  
That way, I dont have to mess with the logic of spacing the grid lines, dealing with zoom etc.

Plotly can decide the values where the tick marks are placed depending on the zoom level

I can simply specify the logic for generating the label given the value.
