Rounding a number

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Videotron

    Rounding a number

    I would like to know how to round a number to its higher value (Ex. 5.3=6
    5.5=6 5.9=6 and 5.1=6) I'm trying to do it with a simple expression
    =(Round([text85];1))*[text81]

    thanks in advance
    markfou


  • Allen Browne

    #2
    Re: Rounding a number

    The Int() function rounds a number down.
    To round a number up: negate, use Int(), and negate the result:
    =-Int(-[MyValue])

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "Videotron" <1@1.com> wrote in message
    news:o9__c.3185 5$ek1.489284@wa gner.videotron. net...[color=blue]
    >I would like to know how to round a number to its higher value (Ex. 5.3=6
    >5.5=6 5.9=6 and 5.1=6) I'm trying to do it with a simple expression
    >=(Round([text85];1))*[text81]
    >
    > thanks in advance
    > markfou[/color]


    Comment

    • Videotron

      #3
      Re: Rounding a number

      Thanks it worked perfectly, but I have one more question. How do I round a
      number after one decimal EX: 2,12=2,2 , 2,17=2,2, 3,54=3,6
      =-Int(-(((([Text74]*([Text106]*0,01)))*0,7777 777778)/30))

      Thanks
      markfou
      "Allen Browne" <AllenBrowne@Se eSig.Invalid> wrote in message
      news:413c70f8$0 $19715$5a62ac22 @per-qv1-newsreader-01.iinet.net.au ...[color=blue]
      > The Int() function rounds a number down.
      > To round a number up: negate, use Int(), and negate the result:
      > =-Int(-[MyValue])
      >
      > --
      > Allen Browne - Microsoft MVP. Perth, Western Australia.
      > Tips for Access users - http://allenbrowne.com/tips.html
      > Reply to group, rather than allenbrowne at mvps dot org.
      >
      > "Videotron" <1@1.com> wrote in message
      > news:o9__c.3185 5$ek1.489284@wa gner.videotron. net...[color=green]
      >>I would like to know how to round a number to its higher value (Ex. 5.3=6
      >>5.5=6 5.9=6 and 5.1=6) I'm trying to do it with a simple expression
      >>=(Round([text85];1))*[text81]
      >>
      >> thanks in advance
      >> markfou[/color]
      >[/color]




      Comment

      • Allen Browne

        #4
        Re: Rounding a number

        Multiply by 10.
        Negate.
        Int()
        Negate.
        Divide by 10.

        "Videotron" <1@1.com> wrote in message
        news:Cm9%c.5640 2$ek1.1026391@w agner.videotron .net...[color=blue]
        > Thanks it worked perfectly, but I have one more question. How do I round a
        > number after one decimal EX: 2,12=2,2 , 2,17=2,2, 3,54=3,6
        > =-Int(-(((([Text74]*([Text106]*0,01)))*0,7777 777778)/30))
        >
        > Thanks
        > markfou
        > "Allen Browne" <AllenBrowne@Se eSig.Invalid> wrote in message
        > news:413c70f8$0 $19715$5a62ac22 @per-qv1-newsreader-01.iinet.net.au ...[color=green]
        >> The Int() function rounds a number down.
        >> To round a number up: negate, use Int(), and negate the result:
        >> =-Int(-[MyValue])
        >>
        >> --
        >> Allen Browne - Microsoft MVP. Perth, Western Australia.
        >> Tips for Access users - http://allenbrowne.com/tips.html
        >> Reply to group, rather than allenbrowne at mvps dot org.
        >>
        >> "Videotron" <1@1.com> wrote in message
        >> news:o9__c.3185 5$ek1.489284@wa gner.videotron. net...[color=darkred]
        >>>I would like to know how to round a number to its higher value (Ex. 5.3=6
        >>>5.5=6 5.9=6 and 5.1=6) I'm trying to do it with a simple expression
        >>>=(Round([text85];1))*[text81]
        >>>
        >>> thanks in advance
        >>> markfou[/color][/color][/color]


        Comment

        Working...