Article View: borland.public.delphi.language.objectpascal
Article #119Re: math test!
From: Betsy
Date: Mon, 26 Jan 2004 22:44
Date: Mon, 26 Jan 2004 22:44
47 lines
3004 bytes
3004 bytes
no possibility of being negative... works fairly well with the exception of a large number of small orders that have barely exceeded the qty available... A lot of orders for 4 or 8 units against a total of 5000 units where the total ordered is like 5059... so I would need to reduce the orders/allocate by about .0117... plays hell... allocates about everything down to zero... so distributes less then 10 units over the 5000... I was surprised to see that and am not quite sure how to deal with it. Back to the drawing board. I was planning on letting the user deal with the slack.. find some nice way to present the 4-8 units that didn't get distributed... and put them where she wants.. she had been doing this all by hand in the past so to get it that close would be a god-send... but if calculating it is going to make it worse then doing by hand... no point. I didn't think it would be that big of a deal until I started actually doing it. fun! b "Dr John Stockton" <spam@merlyn.demon.co.uk> wrote in message news:ISEeYzPoEoEAFwaS@merlyn.demon.co.uk... > JRS: In article <40119d6f$1@newsgroups.borland.com>, seen in news:borla > nd.public.delphi.language.objectpascal, Betsy > <betsy.a.tainer@lesschwab.com> posted at Fri, 23 Jan 2004 14:17:17 :- > > > but I need a function that will round to the nearest specified > >integer/multiple > > If there is a possibility that the input number may be negative, more > thought than I have so far seen in this thread is needed. > > See <URL:http://www.merlyn.demon.co.uk/pas-chop.htm> and adapt what is > there in accordance with other answers in this thread, or /vice versa/. > > -- > � John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME. � > <URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links; > <URL:http://www.merlyn.demon.co.uk/clpb-faq.txt> RAH Prins : c.l.p.b mFAQ; > <URL:ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip> Timo Salmi's Turbo Pascal FAQ.
Technical Details
Message-ID:
<40159866$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news-out.visi.com!petbe.visi.com!nntp5.savvis.net!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<40119d6f$1@newsgroups.borland.com> <ISEeYzPoEoEAFwaS@merlyn.demon.co.uk>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 109d30,29d91c8ce2e06858 X-Google-Attributes: gid109d30,public X-Google-ArrivalTime: 2004-01-26 14:53:30 PST From: "Betsy" <betsy.a.tainer@lesschwab.com> Newsgroups: borland.public.delphi.language.objectpascal References: <40119d6f$1@newsgroups.borland.com> <ISEeYzPoEoEAFwaS@merlyn.demon.co.uk> Subject: Re: math test! Date: Mon, 26 Jan 2004 14:44:52 -0800 Lines: 49 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 12.111.178.19 Message-ID: <40159866$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1075157094 12.111.178.19 (26 Jan 2004 14:44:54 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news-out.visi.com!petbe.visi.com!nntp5.savvis.net!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail