Dear Michael,
I please need your help with a coding problem.
Everything is good in here...
>>
Mileage incurred prior to 1/1/2007:>, Subtotal: $>
Mileage incurred on or after 1/1/2007:>, Subtotal: $>
---Up to this point---
>Mileage Total: $>
I want dollar values with cents ($XX.YY) for Memory 54, 55, & 59.
Memory 54 works & looks correct. Memory 55 works & looks correct.
In the last addition line of code the final value (59) gets rounded off rather than extending to 2 decimal points as a dollar value.
For example...
Mileage incurred prior to 1/1/2007:10, Subtotal: $4.45
Mileage incurred on or after 1/1/2007:20, Subtotal: $9.70
Mileage Total: $14 (<-- Should have been $14.15)
Any suggestions would be appreciated!
Thanks!
Sincerely,
Michael Lerner
Network Administrator
Lerner, Moore, Silva, Cunningham & Rubel
www.injuryatwork.com
(909) 889-1131
A1 Letter Coding: Addition with Decimals
A1 Letter Coding: Addition with Decimals
Sincerely,
Michael Lerner
Network Administrator
Lerner, Moore, Silva, Cunningham & Rubel
www.injuryatwork.com
(909) 889-1131
Michael Lerner
Network Administrator
Lerner, Moore, Silva, Cunningham & Rubel
www.injuryatwork.com
(909) 889-1131
Re: A1 Letter Coding: Addition with Decimals
Michael - you have not specified any parameters for your STR function which is why it is getting "rounded off" whereas in the others you are specifying. For example in the first part of your code which works you have:
str(val(thisform.aStorage(46)) * .445,9, 2)
you have specified to include a total of 9 characters (including the decimal point of which 2 will be to the right of the decimal point.
Therefore you would need to make a minor change
from this:
>
to this:
>
Note: the largest number this will accommodate would be 999999.99 (which is a total of 9 characters including the decimal point). If you need to allow for a value in the millions then change it to 10,2 instead of 9,2 which would accommodate a number a penny less than 10 million.
Also, if you need to do "alignment" of the numbers then do not include the alltrim. For example:
with the alltrim to remove spaces you might have:
123.45
12.33
1.59
without the alltrim you might have:
123.45
12.33
1.59
Mike
str(val(thisform.aStorage(46)) * .445,9, 2)
you have specified to include a total of 9 characters (including the decimal point of which 2 will be to the right of the decimal point.
Therefore you would need to make a minor change
from this:
>
to this:
>
Note: the largest number this will accommodate would be 999999.99 (which is a total of 9 characters including the decimal point). If you need to allow for a value in the millions then change it to 10,2 instead of 9,2 which would accommodate a number a penny less than 10 million.
Also, if you need to do "alignment" of the numbers then do not include the alltrim. For example:
with the alltrim to remove spaces you might have:
123.45
12.33
1.59
without the alltrim you might have:
123.45
12.33
1.59
Mike
Re: A1 Letter Coding: Addition with Decimals
Dear Michael,
Thank you very much! The change worked as listed!
Sincerely,
Michael Lerner
Network Administrator
LMSCR
Thank you very much! The change worked as listed!
Sincerely,
Michael Lerner
Network Administrator
LMSCR
Sincerely,
Michael Lerner
Network Administrator
Lerner, Moore, Silva, Cunningham & Rubel
www.injuryatwork.com
(909) 889-1131
Michael Lerner
Network Administrator
Lerner, Moore, Silva, Cunningham & Rubel
www.injuryatwork.com
(909) 889-1131