Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strange interaction of MOD() and INT()
Message
From
24/08/2006 10:20:48
 
 
To
23/08/2006 15:59:34
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01147970
Message ID:
01148206
Views:
14
Hi Fabio,

it's a bit difficult to duplicate the problem now. I've included the ROUND(m.tnElapsedSeconds,0) in my function and all seems well. It is confusing to me that two datetime fields (in an SQL Server backend but put in a VFP cursor) when subtracted on the report could have resulted in a non-integer number of seconds, but apparently that is what was happening.

>>Hi,
>>
>>I've got a function that displays seconds in the format HH:MM:SS.
>>
>>In calculating the seconds part of the string, I do this:
>>
>>
>>INT(m.tnElapsedSeconds % 60)
>>
>>
>>When m.tnElapsedSeconds = 71 I get 10 being returned, but only when the function is called in a report!
>>
>>Anybody have any idea what could be causing this?
>
>are you sure is it 71 ?.
>
>try
>
>? (m.tnElapsedSeconds - 71)*1E18
>
>
>YOU CAN TRY
>
>INT(m.tnElapsedSeconds) % 60
>REOUND(m.tnElapsedSeconds,0) % 60
>
>
>but for some m.tnElapsedSeconds INT() and ROUND() fails.
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform