How to adjust decimal values

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 @suraj_gaikwad

Can you try this

Math.Floor(100.03)

Regards,

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

@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

@suraj_gaikwad,

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

@suraj_gaikwad,

Ok so you will have the values in a datatable right?

Yes ,

The values are not fix its changes
@ashokkarale

Hello guys

Anyone knows how i can handle this

@ashokkarale @lrtetala @jast1631 @Anil_G

Thanks

@suraj_gaikwadm,

Here is my modified solution with Datatable as source.

Output:

Source Code:
TestBot.zip (163.6 KB)