Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import locale
- def body():
- suggestion = 3500
- str_value = input(
- "Digite a pretenção salarial (exemplo: R${}): ".format(
- locale.format("%.2f", suggestion)
- )
- )
- value = locale.atof(str_value)
- print(
- "Valor numérico interno: {}. Valor formatado: {}".format(
- value,
- locale.format("%.2f", value, grouping=True, monetary=True)
- )
- )
- def main():
- for locale_name in ("pt_BR", "en_US"):
- locale.setlocale(locale.LC_ALL, (locale_name, ""))
- print("nnExemplo usando o locale {}: n".format(locale_name))
- body()
- if __name__ == "__main__":
- main()
- numero = input('Entre com o numero : ')
- novoNumero = numero.replace(".",",")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement