Sorry, Tom, I didn't think it through. Try this:

Add .25 to your value, then take the (truncated) integer of the result, and
divide that by .50. That gives you the number of 50-cents in your answer, so
multiply all that by .50, (or divide by 2).

(.50 * (int((currvalue + .25) / .50 ))

Bill

On Mon, Aug 29, 2011 at 7:40 PM, TOM HART <[email protected]> wrote:

> Bill,
>     I tried 7.46 and it returned 7.4, but I want 7.5
> Tom
>
> ------------------------------
> *From:* Bill Downall <[email protected]>
> *To:* RBASE-L Mailing List <[email protected]>
> *Sent:* Mon, August 29, 2011 4:59:29 PM
> *Subject:* [RBASE-L] - Re: Rounding
>
> Tom,
>
> Multiply by fifty, find the nearest integer, then divide by 50.
>
> ((nint((50 * currencycolumn)) / 50)
>
> Bill
>
> On Mon, Aug 29, 2011 at 5:17 PM, TOM HART <[email protected]> wrote:
>
>> Is there a way to round currency to the nearest .50,  what I want to do is
>> round currency the the nearest dollar or .50
>> eg
>>
>> $1.76        to        $2.00
>> $1.74        to        $1.50
>> etc
>>
>> Tom Hart
>>
>>
>

Reply via email to