我已按照https://codereview.stackexchange.com/questions/148853/convert-an-amount-to-indian-notation给出的提示
能在印度逗号格式来显示一个数,其中123456789
将显示为1,23,34,56,789
使用命令:
print("INR {}".format(currency_in_indian_format(123456789))).
不过,我一直没能有此功能扩展的大熊猫数据帧来显示所有的值。有没有什么办法,这可以通过修改命令来完成:
pd.options.display.float_format = '{:,.3f}'.format
如果是印度卢比,使用方法:
from babel.numbers import format_currency
print(format_currency(123456789, 'INR', locale='en_IN').replace(u'\xa0', u' '))
输出:
₹ 12,34,56,789.00
注 - 您的预计产量有3号重复两次,因此不匹配我的。