on 06-17-2010 11:14 AM
Hi,
We have a requirement where we need to generate the decimal point in the value based on the field.
We have 2 source fields NumOfDec and Value and target field Netprice. requirement is based on the Number of decimals in the
NumOfDec field and target netprice field shd have value with those many decimal value.
Eg:1
Suppose Value = 234
NumOfDec = 2 then netprice = 23.4
Eg:2
Suppose Value = 7650
NumOfDec = 1 then netprice = 765.0
If we are doing using Graphical using Power and Divide functions, its working fine but when the value is ending with zero, it doesnt show zero value in the output
as in the above example the out put shd be 765.0 but we are getting 765 when NumOfDec = 1. Jus trying if We can achieve this without UDF.
Regards,
Varun
You can use arithm. function formatNumber, combined with if statement for NumOfDec, which could be 0,1,2 for example.
Be careful when you use Divide, as rounding of PI is not always correct.
better create a UDF based on BigDecimals
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.