Skip to content

Modern Finance RoundMode

Paul Squires edited this page Oct 19, 2026 · 5 revisions

Home › Finance › Finance › RoundMode

RoundMode

Returns the amount rounded to 0 to 4 places by a rounding rule you name.

Syntax

RoundMode( byval digits as int32, byval mode as int32 ) as Currency

Notes

  • Round( digits ) is this with half-to-even; this is the form that lets the rule be named instead of assumed.
  • Half-to-even is what accounting standards generally ask for, because a long run of halves rounded away from zero drifts upwards.
  • digits is 0 to 4 -- four is where the representation ends.
  • Immutable.

Examples

#import "std/money"
using money

dim as Currency c = CurrencyFromParts( 0, 2500 )      '' 0.2500

print c.Round( 3 ).ToString( )                '' 0.2500 -- unchanged, 3 dp
print c.RoundMode( 3, 0 ).ToString( )         '' 0.2500

'' The point is that the rule is written down at the call site rather
'' than inherited from whatever the default happens to be

Library: Finance
Category: Finance
Documented under: Members

Clone this wiki locally