Forum Discussion
- richieCommunity HeroHey shiva1020243,
Can you provide more info to clarify?
When you say "source", are you using the datasource functionality? If "yes", how are you using it?
Or, is the numerics a value in a response?
Cheers,
Rich - TNeuschwangerCommunity 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_mSmartBear Alumni (Retired)
Thanks everyone!
Hi shiva1020243, does the advice from the Community help? Please let us know.
Related Content
- 5 years ago
- 4 years ago
Recent Discussions
- 8 days ago
- 11 days ago