mathx

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const Dimension = 2
View Source
const DimensionSF = 4

Variables

This section is empty.

Functions

func CountSignificantFigures

func CountSignificantFigures(numStr string) int

CountSignificantFigures นับจำนวนเลขนัยสำคัญในตัวเลข

func FloatDecimal

func FloatDecimal(num float64, precision int) float64

func FormatSignificantFigures

func FormatSignificantFigures(num float64, sigFigs int) string

FormatSignificantFigures แปลงตัวเลขเป็น string โดยแสดงเลขนัยสำคัญตามที่กำหนด

func PercentDiff

func PercentDiff(current, previous float64) (float64, error)

func RoundInt

func RoundInt(num float64) int

func RoundToSignificantFigures

func RoundToSignificantFigures(num float64, sigFigs int) float64

RoundToSignificantFigures ปัดเศษตัวเลขให้มีจำนวนเลขนัยสำคัญตามที่กำหนด

func RoundToSignificantFiguresPtr

func RoundToSignificantFiguresPtr(num *float64, sigFigs int) *float64

RoundToSignificantFigures ปัดเศษตัวเลขให้มีจำนวนเลขนัยสำคัญตามที่กำหนด

func RoundToSignificantFiguresPtrSafe

func RoundToSignificantFiguresPtrSafe(num *float64, sigFigs int) float64

RoundToSignificantFigures ปัดเศษตัวเลขให้มีจำนวนเลขนัยสำคัญตามที่กำหนด

func RoundToTwoDecimals

func RoundToTwoDecimals(num float64) float64

func ToPercentage

func ToPercentage(value float64) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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