Skip to content

Modern Finance Total

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

Home › Finance › Finance › Total

Total

Returns the running total as a Currency, rounded once; reading it does not reset it.

Syntax

CurrencyAccum.Total( ) as Currency

Notes

  • Where the single rounding happens: the accumulator carries 128 bits and this is the one point at which the result comes back to four decimal places.
  • Reading it does not reset the accumulator; Reset does that.
  • Count says how many amounts went in, which is how a caller checks it accumulated what it meant to.

Examples

#import "std/money"
using money

dim acc as CurrencyAccum

for i as int32 = 1 to 3
    acc.Add( CurrencyFromDouble( 0.1 ) )
next

print acc.Count( )           '' 3
print acc.Total( ).ToString( )                '' 0.3000

'' Reading does not reset
print acc.Total( ).ToString( )                '' 0.3000

Library: Finance
Category: Finance
Documented under: Members

Clone this wiki locally