Am having both decimal and whole numbers in my list. If the input is decimal then i need to change into a whole number or else i shud retain the input.
For example if the input is 0.1 then the o/p shud be 10 and if the input is 5 then o/p shud be the same 5.
Thanks in advance
functions
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 467
- Joined: Tue Mar 20, 2007 6:36 am
- Location: Chennai
- Contact:
With what logic are you converting 0.1 to 10, are you multiplying with 100?
What do you expect when the input is 0.01?
What do you expect when the input is 0.01?
Minhajuddin
<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Actually the column consists of both kinda data i mean decimal as well as whole number.Minhajuddin wrote:With what logic are you converting 0.1 to 10, are you multiplying with 100?
What do you expect when the input is 0.01?
Am in need to convert the decimal value by multiplying with 100. Because we are treating the decimal data as a percentage value.
Thanks..
Two options:
1. Check if the first char is 0, if yes then multiply by 100 else pass the input value. eg If left(input.col,1)=0 then input.col*100 else input.col
2. Check if the input value has a decimal (.) in it, if so multiple by 100 or pass the input value eg If index(input.col,'.')<>0 then input.col*100 else input.col
1. Check if the first char is 0, if yes then multiply by 100 else pass the input value. eg If left(input.col,1)=0 then input.col*100 else input.col
2. Check if the input value has a decimal (.) in it, if so multiple by 100 or pass the input value eg If index(input.col,'.')<>0 then input.col*100 else input.col