Hello Everyone,
How we can adjust decimal values to complete 100
For example
14.29
14.29
14.29
14.29
14.29
14.29
14.29 = 100.03
Output is coming like this so i need to adjust any one amount so it can be hundred.
Thanks
Hello Everyone,
How we can adjust decimal values to complete 100
For example
14.29
14.29
14.29
14.29
14.29
14.29
14.29 = 100.03
Output is coming like this so i need to adjust any one amount so it can be hundred.
Thanks
Hi you can convert your value to integer
Using Cint(100.03)
Or convert.toInteger
You can use round off function also and set limit to 0
@suraj_gaikwad
use like this…
anyoneamount = If(Total>100,anyoneamount-(total-100),anyoneamount+(total-100))
here anyoneamount is the amount from one of the 14.29 that you want to adjust…total is the actual total
cheers
Assuming you are storing the decimal values into an decimal array.
Here is a solution
Code:
Output:
Sample Project:
TestBot.zip (148.2 KB)
Hi
Basically I’m using this code
After this i have to put one by one value on portal of total amount is hundred if not hundred then i have to adjust any value which will be come
@ashokkarale
@Anil_G
@jast1631
@lrtetala
Thanks everyone
Ok so you will have the values in a datatable right?
Yes ,
The values are not fix its changes
@ashokkarale
@suraj_gaikwadm,
Here is my modified solution with Datatable as source.
Output:
Source Code:
TestBot.zip (163.6 KB)