on 04-29-2009 3:17 PM
Hi,
A quantity of five items will appear as 5.0 for example. . So we need to pass 5 in the target.
Validations:
We can not have quantity in decimals (e.g. 5.1,1.3,23.5,1111.6 0.5 etc)
Quantity can not be non numeric or blank.
Thanks in Advance.
I need UDF or v can do in Graphical Mapping
u can acheive this by using standard function FormatNum and specify the format as ### which indicates numeric
Rajesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Praveen,
If you want 5.1 to be 5, and 5.5 to be 5 and 5.6 to be 6 then you can use standard function ceil and floor.
But if you want 5.1, 5.5 and 5.6 then you need to use a UDF. So you need to get the value what ever is there before the . symbol.
Create a Value user defined function and name it as GetValue. Take one argument as a.
int i = a.indexOf(".");
a = a.substring(0,i);
return(a);
Regards,
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use floor function under Arithmetic Functions...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Step1 )
use below code to check if the data eneterd is Numeric..
for (int i = 0; i < str.length(); i++) {
//If we find a non-digit character we return false.
if (!Character.isDigit(str.charAt(i)))
return false;
}
return true;
Step 2)
if it is numeric, then use the Floor function to give you the non-Decimal value; and it does work n gives the correct number..
example ;
for 5.1 it gives 5
for 1.3 it gives 1
for 23.5 it gives 23 etc...
Step 3)
to check if the numebr is null; in graphical mapping use constant(with null) compare witrh data using Equals and then use Boolean funtion if then
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
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.