Hi all,
I'm having some trouble understanding how to get the Round function to work
like I want it to.
A little background first:
On one of my layouts I have put fields that we fill in with the number of
hours we've used on a certain job, like:
Photography field: 1,20
Darkroom work: 2,15
A calculation adds these and puts the total of 3,35 in a field called, let's
say "NUMBER".
Now, I want the numbers rounded up to the nearest half, i.e 3,35 -> 3,50,
and 3,75 -> 4,00
I've made a display field that's supposed to show the rounded number (3,50)
and given this field the calculation:
Round(NUMBER;2)
(remember that my version differs from the US one and uses ";" instead of
"," as an separator)
and of course this shows me the correct value of 3,35, but I want it to show
me 3,50.
Now I've surfed and surfed and googled my brains out, but cant find out how
to set the field right.
Can anyone in here enlighten me on this subject.
Regards,
Henning
Norway
|
|
0
|
|
|
|
Reply
|
Henning
|
6/2/2004 11:25:55 AM |
|
This will work with all versions. If your using ver 7, I would think the
new ceiling and floor functions would allow you more flexibility in
solving this problem.
Case(
NUMBER - Int(NUMBER) <= ,5; NUMBER + Mod( ,5 - Round( Mod( NUMBER;
,5 ) ; 2 ) ; ,5 );
NUMBER - Int(NUMBER) > ,5; Int(NUMBER) + 1 )
Michael Myett
Henning Sannerhaugen wrote:
> Hi all,
> I'm having some trouble understanding how to get the Round function to work
> like I want it to.
>
> A little background first:
> On one of my layouts I have put fields that we fill in with the number of
> hours we've used on a certain job, like:
>
> Photography field: 1,20
> Darkroom work: 2,15
>
> A calculation adds these and puts the total of 3,35 in a field called, let's
> say "NUMBER".
>
> Now, I want the numbers rounded up to the nearest half, i.e 3,35 -> 3,50,
> and 3,75 -> 4,00
>
> I've made a display field that's supposed to show the rounded number (3,50)
> and given this field the calculation:
> Round(NUMBER;2)
>
> (remember that my version differs from the US one and uses ";" instead of
> "," as an separator)
>
> and of course this shows me the correct value of 3,35, but I want it to show
> me 3,50.
>
> Now I've surfed and surfed and googled my brains out, but cant find out how
> to set the field right.
>
> Can anyone in here enlighten me on this subject.
>
> Regards,
> Henning
>
> Norway
>
|
|
0
|
|
|
|
Reply
|
Michael
|
6/2/2004 12:12:49 PM
|
|
When you specify two decimal places in the Round function, as you did, it
won't round up to the half. 3.35 will stay 3.35. You need to change
Round(NUMBER;2) to Round(NUMBER;1), then your examples will round
correctly. However, they will not display the trailing zero. You will
end up with 3.5 and 4 instead of 3.50 and 4.00. If you need the trailing
zeros, you might consider a calculation field, text result, for display
that adds these back in.
Steve Brown
In article <BCE385E3.37D9%henning@liergrafiske.no>, Henning Sannerhaugen
<henning@liergrafiske.no> wrote:
>Hi all,
>I'm having some trouble understanding how to get the Round function to work
>like I want it to.
>
>A little background first:
>On one of my layouts I have put fields that we fill in with the number of
>hours we've used on a certain job, like:
>
>Photography field: 1,20
>Darkroom work: 2,15
>
>A calculation adds these and puts the total of 3,35 in a field called, let's
>say "NUMBER".
>
>Now, I want the numbers rounded up to the nearest half, i.e 3,35 -> 3,50,
>and 3,75 -> 4,00
>
>I've made a display field that's supposed to show the rounded number (3,50)
>and given this field the calculation:
>Round(NUMBER;2)
>
>(remember that my version differs from the US one and uses ";" instead of
>"," as an separator)
>
>and of course this shows me the correct value of 3,35, but I want it to show
>me 3,50.
>
>Now I've surfed and surfed and googled my brains out, but cant find out how
>to set the field right.
>
>Can anyone in here enlighten me on this subject.
>
>Regards,
>Henning
>
>Norway
|
|
0
|
|
|
|
Reply
|
eyebrown
|
6/2/2004 12:13:16 PM
|
|
Thanks Michael,
I didn't understand a thing, but it worked like a charm.
Do you, or anybody else in here know of any sites covering operators and
functions for newbies like me (who develop allergic rashes when faced with a
string like this)
Henning
On 02-06-04 14:12, in article 5vjvc.13911$bD4.9520@nwrdny02.gnilink.net,
"Michael Myett" <mmyett@hotmail.com> wrote:
> This will work with all versions. If your using ver 7, I would think the
> new ceiling and floor functions would allow you more flexibility in
> solving this problem.
>
> Case(
> NUMBER - Int(NUMBER) <= ,5; NUMBER + Mod( ,5 - Round( Mod( NUMBER;
> ,5 ) ; 2 ) ; ,5 );
> NUMBER - Int(NUMBER) > ,5; Int(NUMBER) + 1 )
>
> Michael Myett
>
> Henning Sannerhaugen wrote:
>> Hi all,
>> I'm having some trouble understanding how to get the Round function to work
>> like I want it to.
>>
>> A little background first:
>> On one of my layouts I have put fields that we fill in with the number of
>> hours we've used on a certain job, like:
>>
>> Photography field: 1,20
>> Darkroom work: 2,15
>>
>> A calculation adds these and puts the total of 3,35 in a field called, let's
>> say "NUMBER".
>>
>> Now, I want the numbers rounded up to the nearest half, i.e 3,35 -> 3,50,
>> and 3,75 -> 4,00
>>
>> I've made a display field that's supposed to show the rounded number (3,50)
>> and given this field the calculation:
>> Round(NUMBER;2)
>>
>> (remember that my version differs from the US one and uses ";" instead of
>> "," as an separator)
>>
>> and of course this shows me the correct value of 3,35, but I want it to show
>> me 3,50.
>>
>> Now I've surfed and surfed and googled my brains out, but cant find out how
>> to set the field right.
>>
>> Can anyone in here enlighten me on this subject.
>>
>> Regards,
>> Henning
>>
>> Norway
>>
|
|
0
|
|
|
|
Reply
|
Henning
|
6/2/2004 12:48:07 PM
|
|
Round only rounds to decimal places, not to the nearest half, whole,
etc. Try this:
Round(Number * 2;1) / 2.
Format the field to show two decimal places.
|
|
0
|
|
|
|
Reply
|
Kevin
|
6/2/2004 1:47:49 PM
|
|
Your welcome.
I would start at www.databasepros.com lots of open source files to pick
apart. Go to resources and search for calculations, should get you started.
If you prefer books go to amazon.com and search for FileMaker. There's a
lot of good FM books out there but plenty of junk too, so read the
reviews carefuly; they are generally on the mark.
Good luck.
Michael Myett
Henning Sannerhaugen wrote:
> Thanks Michael,
>
> I didn't understand a thing, but it worked like a charm.
>
> Do you, or anybody else in here know of any sites covering operators and
> functions for newbies like me (who develop allergic rashes when faced with a
> string like this)
>
>
> Henning
>
> On 02-06-04 14:12, in article 5vjvc.13911$bD4.9520@nwrdny02.gnilink.net,
> "Michael Myett" <mmyett@hotmail.com> wrote:
>
>
>>This will work with all versions. If your using ver 7, I would think the
>>new ceiling and floor functions would allow you more flexibility in
>>solving this problem.
>>
>>Case(
>> NUMBER - Int(NUMBER) <= ,5; NUMBER + Mod( ,5 - Round( Mod( NUMBER;
>>,5 ) ; 2 ) ; ,5 );
>> NUMBER - Int(NUMBER) > ,5; Int(NUMBER) + 1 )
>>
>>Michael Myett
>>
>>Henning Sannerhaugen wrote:
>
>
>
>>>Hi all,
>>>I'm having some trouble understanding how to get the Round function to work
>>>like I want it to.
>>>
>>>A little background first:
>>>On one of my layouts I have put fields that we fill in with the number of
>>>hours we've used on a certain job, like:
>>>
>>>Photography field: 1,20
>>>Darkroom work: 2,15
>>>
>>>A calculation adds these and puts the total of 3,35 in a field called, let's
>>>say "NUMBER".
>>>
>>>Now, I want the numbers rounded up to the nearest half, i.e 3,35 -> 3,50,
>>>and 3,75 -> 4,00
>>>
>>>I've made a display field that's supposed to show the rounded number (3,50)
>>>and given this field the calculation:
>>>Round(NUMBER;2)
>>>
>>>(remember that my version differs from the US one and uses ";" instead of
>>>"," as an separator)
>>>
>>>and of course this shows me the correct value of 3,35, but I want it to show
>>>me 3,50.
>>>
>>>Now I've surfed and surfed and googled my brains out, but cant find out how
>>>to set the field right.
>>>
>>>Can anyone in here enlighten me on this subject.
>>>
>>>Regards,
>>>Henning
>>>
>>>Norway
>>>
>
>
|
|
0
|
|
|
|
Reply
|
Michael
|
6/2/2004 2:37:50 PM
|
|
|
5 Replies
304 Views
(page loaded in 0.066 seconds)
Similiar Articles: Rounding numbers - comp.databases.filemakerHi all, I'm having some trouble understanding how to get the Round function to work like I want it to. A little background first: On one of my layout... Rounding off - comp.lang.idl-pvwaveCarsten Lechte writes: > It should also be noted, that this method, or indeed anything that > involves rounding, does not work if the number to round does not fit ... Rounding (up/down) to a certain number of decimal places - comp ...dropping numbers after the decimal - comp.soft-sys.matlab ... Rounding (up/down) to a certain number of decimal places - comp ... dropping numbers after the decimal ... Rounding Time to Quarter Hour - comp.databases.filemaker ...Rounding numbers - comp.databases.filemaker Rounding numbers - comp.databases.filemaker Rounding Time to Quarter Hour - comp.databases.filemaker ... c# - rounding time ... Round value calculated by equation - comp.cad.solidworks ...INT gives the lowest whole integer of a decimal number, i.e. INT(10.666 ) = 10. For rounding to nearest (up or down), you can add 0.5 to the final, i.e. INT(10.222 + 0.5 ... PROC SQL and round-function - comp.soft-sys.sasHi! I am using PROC SQL to round numbers in a data view, but I have trouble rounding the numbers. proc sql noprint; create view wk1.tmpnrnar... rounding UP by 0.05 - comp.lang.rubyI couldn't catch you that much, but I tried something like: (0.5625*10).ceil.to_f/10 # =3D> 0.6 That will round the number always up. I don't know if that would ... dropping numbers after the decimal - comp.soft-sys.matlab ...Re: negative numbers - comp.soft-sys.sas... there any way to drop the numbers after a decimal? ... > > Round to negative is floor() and round to 0 is fix(). ... Rounding/Merging - comp.soft-sys.sas> > > Thanks in advance > > Apply round/floor or ceiling to the number then subtract 0.5? =A0or add > 0.5? ...not sure what the rules are. > In both cases you presented ... rounding up symbolic expression to 3 decimal places - comp.soft ...Rounding (up/down) to a certain number of ... double - Convert symbolic ... If S is a symbolic constant or constant expression, double returns a double-precision ... Rounding Numbers - Rules & Examples For Fractions & SumsRounding numbers rules including fractions and sums examples. Rounding Numbers - Math tutorials, resources, help, resources and ...How to round numbers. Rounding numbers. ... When rounding whole numbers there are two rules to remember: I will use the term rounding digit - which means: When asked ... 7/26/2012 2:36:00 PM
|