package br.com.alura;
import java.math.BigDecimal;
import br.com.caelum.stella.inwords.FormatoDeReal;
import br.com.caelum.stella.inwords.NumericToWordsConverter;
public class NumeroPorExtenso {
public static void main(String[] args) {
BigDecimal valor = new BigDecimal("75.000");
System.out.println("O valor recebido foi de: " + comprovanteExtenso(valor));
}
public static String comprovanteExtenso(BigDecimal valor) {
NumericToWordsConverter conversor = new NumericToWordsConverter(new FormatoDeReal());
String valorPorExtenso = conversor.toWords(valor.doubleValue());
return valorPorExtenso;
}
}