package com.imsl.test.example.finance; import com.imsl.finance.*; import java.text.NumberFormat; /** *

* Converts a decimal dollar price to a fractional dollar price.

* A decimal dollar price, in this case $1.38, is converted to a fractional * price. * * * @see Code * @see Output */ public class FinanceDollarfrEx1 { public static void main(String args[]) { double decimalDollar = 1.38; int fraction = 8; double dollarfrc = Finance.dollarfr(decimalDollar, fraction); NumberFormat nf = NumberFormat.getInstance(); nf.setMaximumFractionDigits(2); System.out.println("The decimal dollar $1.38 as a fractional dollar = " + nf.format(dollarfrc)); } }