on 08-19-2011 4:26 PM
hi,
In interface one field is supposed , Both dollars and cents will be formatted with an implied decimal point before the last two digits in the data.
for exm : input is -620.27. then output should be -000062027. Maximum length of the field is 10.
if input is 44.44.then output should be 0000004444.
In this way.
Name of the field is Pay_Amount.
how do i get this mapping?
Regards,
Sanghamitra
chk this UDF:
input will be var1
Execution type "Single value"
String a = var1.replace("." , "");
int len=a.length();
if(a.startsWith("-"))
{
String k1 = a.replace("-","");
for(int i=0;i<10-len;i++)
{
k1="0" +k1;
}
return ("-" + k1) ;
}
else
{
for(int i=0;i<10-len;i++)
{
a ="0" +a;
}
return a;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How do i find the length of the substring using UDF ?
Regards,
Sanghamitra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use the replace string function to replace decimal point with null. Then pass the value to a udf.
Write a udf (value cached) and pass the input a= value from Pay_Amount and b - required length of field (10)
public String AddLeading(String a,String b,Container container){
String temp = new String(String.valueOf(Integer.parseInt(a)));
int temp1 = Integer.parseInt(b);
for(int i = 0; (temp1 - a.length()) > i ; i++)
{
temp = "0" + temp;
}
return(temp);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use arthimatic unction 'multiply' and 'formatNumber'.
1.multiply with 100
2.Then furmat number with 0000000000.
Regards,
Raghu_Vamsee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
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.