A
A
Andrey Grinevich2015-11-17 16:32:34
Python
Andrey Grinevich, 2015-11-17 16:32:34

How to bring the prices of different currencies to beautiful prices?

Good day.
I have a mini-shop in the game that sells various temporary bonuses and other goodies, but the platform I want to enter requires the price tag to be in the currency that the player prefers (Rubles for Russia, Euros for Europe, Dollars for USA, etc.). I use conversion rates with api.fixer.io/latest?base=USD , and everything is fine, but the prices are a bit ugly (for example, $ 9.99 in rubles looks like 659.4, but I would like 660 or 699, for example, or 6.5755179 in pounds, but I would like it would be just 6.5, but some currencies only support multiples, say 500 bills and the price tag of 1350 should be 1500)
Are there any ways to bring prices to a "beautiful look"?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dimonchik, 2015-11-17
@dimonchik2013

https://pypi.python.org/pypi/django_price/0.2.1

A
Alexey, 2015-11-17
@RusTech

round

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question