Jump to content

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

Recommended Posts

Posted

i have a calculation field that basically takes the date and time and puts them together to create a decimal number (731134.48173).. its pretty complicated why i am doing this, so i won't go into all the details.. but my problem is, when i try to pull that number into another calculation field, it automattically rounds it to 4 decimal places, which is causing some problems.. how do i get it to keep all 5 decimal places??? this is driving me nuts...

Posted

Are you SURE that is rounds? I have never heard about Filemaker automatically rounding anything, if fact many times I see problems where people DO NOT round and it causes problems when they have fractions of pennies floating around in thier accounting systems.

Are you sure that the layout is simply not formatted to round the result?

Posted

yes i am sure it is rounding.. the first thing i did was to make sure it wasn't just the layout...

here is how you can see it for yourself..

create two fields

LastModDate (DATE field with auto enter of modifier date)

LastModTime (TIME field with auto enter of modifier time)

Create a calc field (number)

LastModDateandTime

with calc:

LastModDate & "." & LastModTime

Then create another calc field, make it a number, call it anything, and just make the calculation:

LastModDateandTime

it will round it off to 4 decimal places.. at least it does on mine.. and it really need it not too..

Posted

How is your field formatted? I assume it's a number field, or the calc field is set to return a result of number. Go to layout mode, highlight the field, go to "Format" at the top of the screen, choose "Number" and you'll get a box with various specs. Check "format as decimal", then "fixed number of decimal places", and fill in "5" in the box. Make sure that "use thousands separator" is unchecked.

This should fix it, but only for screen display. If this number is referred to elsewhere, you might have further problems & have to do something with NumtoText & etc.

Steve Brown

Posted

i fixed it... it had nothing to do with way the field was formatted on the screen (as i have previously said)...

i left out the fact that i was adding a serial number field to the beginning of this calc field as well, I didn't think it would make a difference. Trying to add that field seems like it was making the number field too long and was causing it to round off somehow.. i dunno... its all kinda weird to me..

anyway... i figured out a way around it..

thanks any way guys

bman

Posted

Are you SURE that is rounds? I have never heard about Filemaker automatically rounding anything,

From my experimentation, FileMaker most certainly does round...

Number fields are physically just Text fields, but are treated as numbers (non-numeric characters are ignored) when pulled into expressions. No rounding happens there.

But Number *calculations* are done in IEEE double-precision floating point (as best I can tell). Or perhaps its done in the highest precision native floating point on the platform. Thus, I would expect any Number calculation to round to approx 15 decimal digits of precision.

Note that 731134.48173 is 11 digits of precision. (Its not based on digits right of the decimal... just digits total... they all get normalized to the right anyway.

Thus, if you add a 5-digit serial number to the front of this by doing: 12345000000 + 731134.481736957, then you'll get 12345731134.4817 -- the other digits further to the right will be lost.

If instead you do "12345" & NumToText(731134.481736957), then you'll get all the digits with no rounding "12345731134.481736957", as a text string. Insert that text into a number field, it will stay that way. Set it into a Number field such that it gets converted to a Number object, it'll round.

HTH.

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.