Forum Discussion
TNeuschwanger
4 years agoCommunity Leader
Hello shiva1020243
Here is some groovy script code that can do what you request. Given your ambiguous requirement, I made best guess at a response... 🙂
There are two sections of the code that are identical just to show different originating source values and their outcome.
Regards,
Todd
import java.text.DecimalFormat;
df = new DecimalFormat("#0.000");
interestRateStr = "00550";
interestRateInt = interestRateStr.toInteger();
interestRateFloat = interestRateInt / 1000;
log.info "interestRateFloat=$interestRateFloat";
finalValue = df.format(interestRateFloat);
log.info "finalValue=$finalValue";
interestRateStr = "02000";
interestRateInt = interestRateStr.toInteger();
interestRateFloat = interestRateInt / 1000;
log.info "interestRateFloat=$interestRateFloat";
finalValue = df.format(interestRateFloat);
log.info "finalValue=$finalValue";
sonya_m
Alumni
4 years agoThanks everyone!
Hi shiva1020243, does the advice from the Community help? Please let us know.