on 04-24-2014 4:03 AM
Hi All,
I have requirement where
Input is 1234
and Output should be :-0000001234(6 Zeros at left).
Please let me knw how to do it.
Thanks,
Suraj
hi Suraj,
If you are sure its should be always prefixed with 6 zeros then u can use above mentioned method.
But if you are not sure about the input string lenghth than below udf will help.
s = "000000".substring(s.length()) + s;
where s= input value which is 1234 in ur example given.
hope this solves your problem.
thanks and regards,
Praveen T
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.
if it's always 6 zero's then simply use concat function and append with a constant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Suraj
You can use function FormatNum under Arithmetic.
Enter all zeroes up to the maximum length of your desired output - 10 for your case, and no decimals.
For more information on how patterns for FormatNum works, you can refer to the below link for Java DecimalFormat.
DecimalFormat (Java Platform SE 7 )
Rgds
Eng Swee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.