Hi there I am a newbie to Python, could someone help me how to convert an input string to ZAR (South African Rand) in order to produce the R symbol before the float amount the user enters? Example: R400.00
Assistance will be highly appreciated.
Hi there I am a newbie to Python, could someone help me how to convert an input string to ZAR (South African Rand) in order to produce the R symbol before the float amount the user enters? Example: R400.00
Assistance will be highly appreciated.
There is no special format for currency in standard library. You can organize output formatting like that:
but in finance calculations better use
Decimal
notfloat
.Or - create own class ZAR() with special method
__str__()
if You really need it )