Round up to nearest .50 or dollar

Posted on 2006-06-07
Last Modified: 2012-05-05
Hi experts,

I'm trying to figure out how to calculate the rate increases in my company but we have a special specs.
What I need is to increase rates by 6% but I need to round UP to the nearest 50 cents or to the dollar, whichever is closer.
my rate is 106
6% increase would be 106 + 6.36 = 112.36
This should round up to 112.5

Any questions let me know.

Question by:carlosmonte
    LVL 28

    Expert Comment

    Here is some logic that you can use to round to the nearest 50 cents:

    Round ( ({table.rate}*1.06) / .5 , 0 ) * .5

    You can replace {table.rate}*1.06 with another formula if you are already doing this calculation
    LVL 1

    Author Comment

    This rounds down to. I only need it to round UP.
    LVL 28

    Accepted Solution

    This will always round up, except when the value is evenly divisible by .5:

    local numbervar input := {table.rate}*1.06;

    if remainder(input, 0.5) > 0
    then (int(input/ 0.5) *.5) + .5
    else input
    LVL 1

    Author Comment

    This is almost working. Thanks
    how can I know when its divisible by 0.5?
    I want to insert another if statement to keep the number when its ends with .5
    At the moment if the input is for example 111.5 it rounds UP to 112. I want it to stay as 111.5
    LVL 1

    Author Comment

    forget last comment. Sorry my mistake, was using different formula

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Crystal Reports 8.5 hangs 11 77
    How to add a total 6 23
    String to Date Formula Failure 2 35
    Formatting a Crystal Reports Report 9 43
    Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
    I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now