on 05-26-2010 4:03 PM
Hi,
I want to delete the zeros that comes after the incoming data. i.e. 000001230000 so I get 00000123.
How is that possible?
Best regards
Hi
You can use FormatNum Function or UDF.
Parameter: str
if (str == null){
return null;}
char[] chars = str.toCharArray();int length,index ;length = str.length();
index = length -1;
for (; index >=0;index--)
{
if (chars[index] != '0'){
break;}
}
return (index == length-1) ? str :str.substring(0,index+1);
http://wiki.sdn.sap.com/wiki/display/Java/RemoveLeadingandTrailingZerosfroma+String
Regards
Ramg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If the number of zeroes that are coming after the incoming data is always 4, then divide the incoming data by 10000 and then use the FormatNum standard function. If you are not sure with the trailing zeroes count, then you need to go for a custom UDF.
~Vaas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use the FormatNum standard function in the Arithmetic function.
~Vaas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>>How is that possible?
Using a very simple UDF. Lots of example available in SDN.
Do a search.
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 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.