...
Bloco de código | ||||||
---|---|---|---|---|---|---|
| ||||||
#Include "Protheus.ch" #Include "rwmake.ch" user function Exte() Local nValor as numeric Local lQuantid as logical Local nMoeda as numeric Local cPrefixo as character Local cIdioma as character Local lCent as logical Local lFrac as logical Local lUsaCon as logical Local cPosMoed as character nValor := 3456.72 lQuantid := .F. nMoeda := 1 cPrefixo := "" cIdioma := "1" lCent := .T. lFrac := .F. lUsaCon := .T. //Somente espanhol cPosMoed := "2" cTexto := Extenso(nValor, lQuantid, nMoeda, cPrefixo,cIdioma,lCent,lFrac,lUsaCon, cPosMoed ) CONOUT("******************") CONOUT(cTexto)//TRES MIL, QUATROCENTOS E CINQUENTA E SEIS REAIS E SETENTA E DOIS CENTAVOS CONOUT("******************") Return //Exemplos e retornos: /* Extenso(500.00)= "QUINHENTOS REAIS" Extenso(500.00,.f.,2,,1)= "QUINHENTOS DOLARES" Extenso(1999.78 ,.T.,2) = "ONE THOUNSAND NINE HUNDRED AND NINETY-NINE" Extenso(1999.78 ,.F.,1) = "ONE THOUNSAND NINE HUNDRED AND NINETY-NINE DOLLARS AND SEVENTY-EIGHT CENTS" Extenso(1999.78 ,.F.,1,,,.F.) = "ONE THOUNSAND NINE HUNDRED AND NINETY-NINE DOLLARS" Extenso(1999.78 ,.F.,1,,"3",.T.,.T.) = "ONE THOUNSAND NINE HUNDRED AND NINETY-NINE AND 78/100 DOLLARS" Extenso(1999.78 ,.F.,1,,"2",.T.,.F.)= "UM MIL, NOVECIENTOS NOVENTA Y NUEVE DOLARES Y SETENTA Y OCHO CENTAVOS" Extenso(1999.78 ,.F.,1,,"1",.T.,.F.)= "UM MIL, NOVECENTOS E NOVENTA E NOVE DOLARES E SETENTA E OITO CENTAVOS" Extenso(0.85,.F.,1,,"3",.T.,.T.)= "85/100 DOLLARS" Extenso(0.85,.F.,1,,"3",.T.,.F.)= "EIGHTY-FIVE CENTS" Extenso(2001,.F.,1,,"2",.T.,.F.)= "DOS MIL Y UM DOLARES" Extenso(500.05,.F.,1,,"3",.T.,.F.)= "FIVE HUNDRED DOLLARS AND FIVE CENTS" Extenso(500.05,.F.,1,,"3",.T.,.T.)= "FIVE HUNDRED AND 5/100 DOLLARS" Extenso(500.05,.F.,2,,"1",.T.,.T.)= "QUINHENTOS REAIS E CINCO CENTAVOS" */ |
...