on 11-12-2013 11:54 AM
Hi All,
Can you please help me with this requirement
Input Output
234.5676 234.56
Any number before decimal point.
No Round off after decimal point
Regards,
Abhi
Hi Abhi,
you can use following udf: for that:
-------------------------------------
public String calculate(String a, Container container) throws StreamTransformationException{
int b = a.lastIndexOf(".");
String beforedot = a.substring(0,b);
String afterdot=a.substring(b,b+3);
String result = beforedot+afterdot;
return result;
}
--------------
Regards
Gagan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try standard formatNum function... use parameter #####.##
Ambrish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Its very much possible to achieve it without any UDF.
What about format number?
http://wiki.scn.sap.com/wiki/display/HOME/Message+Mapping+Format+Number
If you are expecting any null values then you can use if then else function accordingly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Indrajit.I tried with Gagandeep Batra it is simple and working fine.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
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.