Table of Contents

Class PaymentMoney

Namespace
NuvTools.Payment
Assembly
NuvTools.Payment.dll

Amounts as a payment provider counts them: whole numbers of the currency's smallest unit.

public static class PaymentMoney
Inheritance
PaymentMoney
Inherited Members

Remarks

BRL 49.90 is 4990, JPY 1,000 is 1000, KWD 1.500 is 1500. The currency's minor units come from the caller — ISO 4217 reference data — because this package does not carry a currency table.

Methods

FromMinorUnits(long, byte)

The inverse, for showing an amount the provider reported.

public static decimal FromMinorUnits(long amountMinor, byte minorUnits)

Parameters

amountMinor long

The amount in minor units.

minorUnits byte

The currency's ISO 4217 places.

Returns

decimal

ToMinorUnits(decimal, byte)

The amount in minor units, rounded half away from zero at the currency's own place. Round once and on the total, never on a unit price: rounding twice is how a total stops matching its lines.

public static long ToMinorUnits(decimal amount, byte minorUnits)

Parameters

amount decimal

The amount to convert.

minorUnits byte

The currency's ISO 4217 places: 2 for BRL, 0 for JPY, 3 for KWD.

Returns

long