COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### Rounding numbers

• Email
• Follow

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

See related articles to this posting

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

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

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

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

5 Replies
384 Views

Similar Articles

11/30/2013 9:03:07 PM
page loaded in 1210314 ms -1

Similar Artilces:

Version Numbers
number built in to my calculator. As far as I know, the MetaKernel version is 3.00 on all 49 series calculators, and the boot version stays the same on any particular calculator, although I understand that it is, at least in theory, possible to rewrite the "boot ROM" on a 49g+, and presumably also on a 50g, but not on a 49G. I'll leave it to Cyrille or Jean-Yves to explain what the various versions, revision, and build numbers are all about. -- Regards, James PS: I wrote: <snip> > The VER command displays: > > HP49 CAS by Parisse, > Heiskanen & Fiechter

Fun with Numbers...!!!
http://wmjas.wikidot.com/simple-english-gematria

Excel/Numbers/NeoOffice
When I input this number - 166879123999 - into either an Excel or Numbers cell the cell translates this to 1.66879E+11. NeoOffice shows the number correctly (one up for Neo). How do I get around this please? Thanks Colin In article <0001HW.C2E3D9C50001D600B019F94F@news.btinternet.com>, Countryman <mail@xxx.co.uk> wrote: > When I input this number - 166879123999 - into either an Excel or Numbers > cell the cell translates this to 1.66879E+11. NeoOffice shows the number > correctly (one up for Neo). > > How do I get around this please? > > Thanks > Colin > Set the cell's format to Number rather than General. -- Spenser In article <0001HW.C2E3D9C50001D600B019F94F@news.btinternet.com>, Countryman <mail@xxx.co.uk> wrote: > When I input this number - 166879123999 - into either an Excel or Numbers > cell the cell translates this to 1.66879E+11. NeoOffice shows the number > correctly (one up for Neo). > > How do I get around this please? > Format the cell as a number, not general, with zero decimal places. -- Tom Stiller PGP fingerprint = 5108 DDB2 9761 EDE5 E7E3 7BDA 71ED 6496 99C0 C7CF

rotating labels in Numbers
I've volunteered for maintain the work hours for a boat. It's a simple spreadsheet. It's currently being done in Excel, the only issue that I have with using Numbers instead of Excel is the column headers can't be rotated. I don't see any way to do that. Is it practical? In article <0001HW.C4BFB16C0030AB28B022F9AF@news.panix.com>, Wayne Dernoncourt <wayned@panix.com> wrote: > I've volunteered for maintain the work hours for a boat. It's a simple > spreadsheet. It's currently being done in Excel, the only issue that I have > with using Numbers instead of Excel is the column headers can't be rotated. > I don't see any way to do that. Is it practical? You can add a rectangle to the table, put text in it, rotate it, and line it up with the header cell. There's no way to directly specify that a cell draws its text rotated, though. Numbers is very much a 1.0 product - I say that fully cognizant of the fact that it's currently labeled 1.0.2 - and you should certainly send along feedback about features that are important to you. AppleWorks won't leave my machine until they address

Complex Numbers HP 49G+

page numbers in the margin?
Hi! all, Today I found a book which has page numbers in the middle of left and right margins. I feel it is cool even though I am not qualified to judge its typographic merits. So my question is, how to do it in LaTeX? Anyone? Thanks in advance, Ven. Pandita Am Wed, 20 Oct 2010 08:27:05 -0700 (PDT) schrieb Pandita: > Hi! all, > > Today I found a book which has page numbers in the middle of left and > right margins. I feel it is cool even though I am not qualified to > judge its typographic merits. So my question is, how to do it in > LaTeX? Anyone... and position of your page numbers more easily with the xwatermark package. The following code is not part of the xwatermark package currently available on CTAN but something similar has been included in the pending version. You can copy it and use it until the newer version of the xwatermark package becomes available. You may want to get rid of head and foot rules if you don't need them. \documentclass[a4paper]{article} \makeatletter \usepackage{xkeyval} \usepackage{fancyhdr} \usepackage{xcolor} \usepackage{picture,graphicx} \usepackage{atbegshi} \usepackage{lipsum} \pagestyle{fancyplain} \def

line numbers & yyerror
Hi everyone, I have a working compiler where the scanner and parser were created using flex and bison respectively. I want to redefine yyerror so that the line number is passed as an argument. The plan is to pass the line info to the parser through yylval and then use it when needed. From what I can see in the bison manual, this can be done if bison creates a pure parser. Is there any other way? And if I do use %pure-parser after all, will there be any modifications other than those mentioned in section 4.2.4 "Calling Conventions for Pure Parsers" of the manual? I'm asking beca

hints on handling large numbers in gawk
of "tricks" do you expect if it's not supported? Here's something I've done (I've posted it here in c.l.a recently to handle IBAN numbers)... 1. variant: use a coprocess and connect to the Unix bc caclulator for doing all the MP math 2. variant: implement MP math (in my case a subset; the modulus) in terms of strings processing You may want to look up those postings. Janis > > example problem: factorial is wrong after factorial(22_ > > function factorial(n, =A0out,i) { > =A0 =A0 =A0if (n < 1) > =A0 =A0 =A0 =A0 =A0return 1... in gawk? i tried the usual >> logging stuff, but to no avail. > > Well, what kind of "tricks" do you expect if it's not supported? Maybe he wanted to titillate some of us about writing up some infinite precision stuff in awk?-) I post below a sample for the proposed factorial sample. Note that the algo used is the schoolie one, not the best but at least it's the simplest to write and more important the simplest to read ;-) > > Here's something I've done (I've posted it here in c.l.a recently to > handle IBAN numbers)... >

Get line numbers with Antlr parser
Hi, I'm using the Java1.5 parser + tree parser by Mike Studman. My problem: I need to extract the line numbers from the parser. Funny thing: in one part of the parser it works, but in the tree parser it doesn't. In java15.g I added some printlns to print getLine() of some nodes, and they printed the lines. The very same nodes are also put into a tree structure to read by the java-tree parser (obviously). Now for some reason the line information disappears while the tree is being built. In java15.tree.g I can add printlns, but the line number of the *same* node as in java15.g is suddenly 0, while it was, say 15, only a second (and I assume a "return") before. Why is this? What can / do I have to do, to get the line numbers to the high level, where I need it? I also tried various ways of modifying the trees built, including creating a custom tree (using #() instead of the ^ often used in java15.g) with some nodes that only have line info. Every time the line info seems to disappear. Unfortunately Antlr documentation isn't really helpful. It only mentions that there *is* the newline() method and that getLine() can be used, but it doesn't explain

numbers in parentheses not showing up in table.
function that replaces zeros with a space was interpreting the numbers in parentheses as being == 0. i changed the function to if ($tbl[$r][\$m] == '0') and it works fine. thanks for you help! bipin

Where to Find Cisco TAN Mapped to Part Numbers?
For reasons I have never understood, Cisco implements CLEI codes for telecom products using its TAN numbers (e.g., 800-08702-01). But customers end up buying cards using marketing part numbers like 15454-OC481LR1550. Occasionally you get a Cisco technical note that cross references these two types of numbering systems, but rarely are such notes comprehensive. Is there a place that Cisco publishes the relationships in a more comprehensive fashion than just technical notes? For a specific case, I'm trying to determine which Cisco marketing part numbers are associated... 15454-OC481LR1550 15454-OC48LR1550 15454-OC48LR1550W Some technical notes suggest that some of these TANs are shared across different marketing numbers, which only serves to grow my confusion on the issue, and to increase the need for a comprehensive cross reference. -- Will

FM7 Duplicating Auto Entered Serial Numbers
I'm having a problem with autoentered serial numbers. The database is multi user, hosted on FMS7. Users create new contact records by clicking a button, which runs a script to create a new records in the contacts table. Out of ~550 records, I've found two pairs of records with duplicate serial numbers. The users can't edit the serial numbers; it looks like FileMaker is assigning them the same serial number if they're created at the same time. Has anybody seen this with 7 before? For now, I've put in a random delay before creating a record... -- --- In article <020920050832393304%BrianHall@nospam.pobox.com>, BrianHall@nospam.pobox.com says... > I'm having a problem with autoentered serial numbers. The database > is multi user, hosted on FMS7. Users create new contact records by > clicking a button, which runs a script to create a new records in the > contacts table. Out of ~550 records, I've found two pairs of records > with duplicate serial numbers. The users can't edit the serial > numbers; it looks like FileMaker is assigning them the same serial > number if they're created at the same time. >

Mac Net Apps share trend analyzed with real numbers and real statistics!
=0BxuJGTDTmSZ1NzFmZGIzM2MtZDY5Yi00MzIwLWI1OWItNmI0ZGRiODkyNDE5&hl=en Taking out the smartphone numbers has a material impact on the computer shares. The trends are based on a 3rd order polynomial. The fit was better than a simple linear equation (R2 vs. linear was improved by about 2 points in both cases). Polynomial fits better simply because the share changes are not a simple linear function over time. Little doubt that Windows 7 has played a major role in the recent shifting trend in share. Again Alan, the sign of the second derivative is negative for Mac and positive for Windows. Maybe you did...; > http://docs.google.com/fileview?id=0BxuJGTDTmSZ1NzFmZGIzM2MtZDY5Yi00MzIwLWI1OW > ItNmI0ZGRiODkyNDE5&hl=en > > Taking out the smartphone numbers has a material impact on the > computer shares. > > The trends are based on a 3rd order polynomial. The fit was better > than a simple linear equation (R2 vs. linear was improved by about 2 > points in both cases). Polynomial fits better simply because the > share changes are not a simple linear function over time. LOL How long did you spend massaging this? > > Little doubt

OT
10.7 6.7 7.7 It's difficult to be exact about the data, since signal is very sensitive to direction, ambient conditions, and cell breathing. To generate these numbers, I measured at least 6 times and took the average. The results are pretty self explanatory. Inside a case, the iPhone 4 performs slightly better than the Nexus One. However, attenuation gets measurably worse depending how you hold the phone. Squeezing it really tightly, you can drop as much as 24 dB. Holding it naturally, I measured an average drop of 20 dB.� The drop in signal from cupping the device with a case