Skip to content

Instantly share code, notes, and snippets.

@vmesel
Created May 5, 2016 01:06
Show Gist options
  • Save vmesel/70343dba30240ba1d45488c7fd689a72 to your computer and use it in GitHub Desktop.
Save vmesel/70343dba30240ba1d45488c7fd689a72 to your computer and use it in GitHub Desktop.
def milhoes(self, num):
*milhoes,mil2,mil1,mil0, cen, dez, uni = num
aux_milhoes = self.transcrever("".join(milhoes))
aux_num = "{m2}{m1}{m0}{c}{d}{u}".format(m2=mil2,m1=mil1,m0=mil0,c=cen,d=dez,u=uni)
if aux_num == "000000":
return(aux_milhoes + "milhões")
else:
return("{mi} milhões e {m}").format(mi=aux_milhoes,m=self.milhar(aux_num))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment