This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
vba:cast:roundcurr [24.08.2016 09:31:59] yaslaw |
vba:cast:roundcurr [31.05.2017 11:01:17] yaslaw [Code] |
||
---|---|---|---|
Line 58: | Line 58: | ||
<Double> 100 | <Double> 100 | ||
</code> | </code> | ||
+ | |||
+ | Auf/Abrunden | ||
+ | <code vb>'Normal runden | ||
+ | d roundCurr(3.6, 0.5) | ||
+ | <Double> 3.5 | ||
+ | |||
+ | 'Alias zu normal. 0.5 wird abgerundet | ||
+ | d roundCurr(3.25, 0.5, rcHalfDown) | ||
+ | <Double> 3 | ||
+ | |||
+ | 'Ab der Hälfte aufrunden | ||
+ | d roundCurr(3.25, 0.5, rcHalfUp) | ||
+ | <Double> 3.5 | ||
+ | |||
+ | 'immer abrunden | ||
+ | d roundCurr(3.4, 0.5, rcDowwn) | ||
+ | <Double> 3 | ||
+ | |||
+ | 'immer aufrunden | ||
+ | d roundCurr(3.1, 0.5, rcUp) | ||
+ | <Double> 3.5</code> | ||
===== Code ===== | ===== Code ===== | ||
+ | Code zum importieren. Wenn er mit C&P in ein neus Modul eingefügt wird, dann muss die Zeile ''Attribute VB_Name = "cast_roundCurr"'' entfernt werden. | ||
+ | |||
<source '%%fpath%%/%%fname%%' vb> | <source '%%fpath%%/%%fname%%' vb> | ||