moneyjuice

package
v1.29.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BankerRoundInt

func BankerRoundInt(x float64) int64

BankerRoundInt rounds a float64 value representing a monetary amount to the nearest integer using banker's rounding.

This method is designed specifically for financial systems where currency values are stored as the smallest denomination (e.g., cents for USD) in int64 variables.

It considers the sign of the value and rounds to the nearest even integer when the fractional part is exactly 0.5.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL