on 08-01-2007 2:43 AM
Hi friends,
Can you help me to do the right justified for example 39.56- this should right side not from left. this field length is 11. infront of this 39.56 should be blank spaceses paded. how to do this
please help me
Thanks
ramidi
Ramidi,
Create simple UDF. Let say my input parameter name is "abc" . Write the below code in it
StringBuffer pad= new StringBuffer();
String ret_string="";
int add=0;
int trunc=0;
if(abc.length()<=11)
{
add =11-abc.length();
}
if(abc.length()>11)
{
ret_string =abc.substring(0,11);
}
else
{
for(int i=0;i<add;i++)
{
pad.append(" ");
}
ret_string = pad.toString()""abc;
}
return""ret_string"";
Hope it helps!!!
Best regards,
raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
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.