# calculation: problem with decimals

This topic is 6999 days old. Please don't post here. Open a new topic instead.

## Recommended Posts

Hello all,

I have this tiny problem, and been looking for couple days but can't seem to find the solution for solving the decimal calculation. So if there is a post on this issue, I apologize for re-posting and please post a link for me if possible ... I hope I could describe this as best as possible

I am implementing a payroll check writter on my database but i faced a problem with the decimals.

I don't know how to put it in words so please see this example:

Shown on the Record:

Gross Pay: 800.00

Fit: 73.62

Fica: 61.20

Sit: 14.37

-----------------

Net: 650.81

The real result (not shown on the record

Gross Pay: 800.00

Fit: 73.623

Fica: 61.198

Sit: 14.374

--------------------

Net: 650.805

I have implemented the check writting created by Geoff Ryle, into my database, but it seems that it doesn't eliminate the extra decimal "5" even if the field shows 650.81 and writes:

"Six Hundred Fifty and 80.5/100" instead of "Six Hundred Fifty and 81/100"

Here is the cents calculation:

Field Name: Cents

Calculation:

Round((Check Amount-Int(Check Amount))*100 +.00005, 2)

Field Name: Cents Text

Calculation:

Case(Mod(Cents,100) = 00, "NO", Mod(Cents,100) < 10, "0" & Mod(Cents,100), Mod(Cents,100))

Hope this is understandable--- Bare with me ...

##### Share on other sites

I think Cents should be Round((Check Amount-Int(Check Amount))*100, 0)

and Cents Text = Case(Cents = 0, "NO", Cents < 10, "0" & Cents, Cents)

##### Share on other sites

RalphL... You are awesome... Can't thank you enough--- now I could write paychecks and stop writting 1200 checks by hand... or try a program that makes you sign up for payroll service or a program that limits the information input... ... ty... let me know if you need anything, will gladly help .

You rock!

Cheers ...

Ron

##### Share on other sites

Hi Ralph,

My suggestion would be to deal with the rounding before they become part of the Net / Written Amount.

Hi ronnie524,

I prefer Ilyse Kazar approach. You can download a copy of her file from site

See the attached file for my stab at your needs using her calculation.

HTH

Lee

PayCheckDeduts.fp5.zip

##### Share on other sites

You can also shorten the cents calc to

Case( Cents, Right( "0" & Cents, 2 ), "NO" )

##### Share on other sites

Thank you all ... I guess whatsoever solution I use... it would give me the same answer ....

Thank you all

##### Share on other sites

Lee, thank you ... actually I was faced with another problem with decimals using "<***>" keys, your solution actually worked better ... ty

yours truly,

Ron

##### Share on other sites

This topic is 6999 days old. Please don't post here. Open a new topic instead.

## Create an account

Register a new account