|
Prev: Variable in module to reference form
Next: Text you entered isn't an tiem in the list BUT IT IS!
From: DS on 1 Jul 2008 14:32 I'm using this to Round Up. Public Function UP(MyField) UP = Int(-100 * [MyField]) / -100 End Function Is there something that I can use to Round Down? Thanks DS
From: DS on 1 Jul 2008 14:37 This seems to work. DS Public Function DN(MyField) DN = Int([MyField] * 100) / 100 End Function
From: Allen Browne on 2 Jul 2008 00:28 "DS" <bootybox(a)optonline.net> wrote in message news:OUWlIm62IHA.4500(a)TK2MSFTNGP06.phx.gbl... > Public Function DN(MyField) > DN = Int([MyField] * 100) / 100 > End Function Yes, that rounds down to 2 places. Be aware of what happens when you round negative values down. It that is not the behavior, use Fix() instead of Int(). Details: http://allenbrowne.com/round.html -- 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.
From: DS on 2 Jul 2008 09:51 Thanks Allen. So should I use Fix instead of Int? I don't beleive that I will have negative values. Thanks DS
From: Allen Browne on 2 Jul 2008 11:12 I'm not saying you should use Fix instead of Int. I'm merely highlighting that "rounding down" and "rounding towards zero" are not the same thing. If you won't ever have a negative value, that's a non-issue. -- 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. "DS" <bootybox(a)optonline.net> wrote in message news:%23iQarqE3IHA.4928(a)TK2MSFTNGP04.phx.gbl... > Thanks Allen. > So should I use Fix instead of Int? > I don't beleive that I will have negative values.
|
Pages: 1 Prev: Variable in module to reference form Next: Text you entered isn't an tiem in the list BUT IT IS! |