on 07-06-2010 12:04 PM
Hi there,
Can somebody please tell me how and what is the solution of this simple case?
Example
1234567890.12
876.11
456789881.34
The above values are present in 1 field not in 2 fields.
the input contains the decimal values as well i.e. field1 = 1234.32
I need to generate an output with fixed length of 17 char which contains 2 decimal and 15 values and if there is no values than I need to add the spaces before the numbers not after the number.
xxxxxxxxxx12345.12
xxxxxxxx3456789.45
where xx represent spaces.
I tried different functions such as formatnumber, substring, indexOf but none of them work according to the requirement.
I believe the only way is to do it via udf so can somebody please help me.
Hi,
U can write UDF and for loop first check the length of the input field using .length java function.
Use for loop and loop till 18 character I am considering "." as one character and append space
chirag
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
u can refer the below link:-
http://www.roseindia.net/java/beginners/length.shtml
use for loop and append space with the number.
Search on google u wil get help.
chirag
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
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.