Rounding in MS Access

后端 未结 12 688
夕颜
夕颜 2020-11-28 14:23

Whats the best way to round in VBA Access?

My current method utilizes the Excel method

Excel.WorksheetFunction.Round(...

But I am l

12条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-28 14:54

    If you're talking about rounding to an integer value (and not rounding to n decimal places), there's always the old school way:

    return int(var + 0.5)
    

    (You can make this work for n decimal places too, but it starts to get a bit messy)

提交回复
热议问题