VBA.VB6 - ümardamise funktsioon (suurem või väiksem kui n)
Ümar () funktsioon annab numbrite vale ümardamise järgmises vormis:
(2a + 0, 5) x 10 ^ -n (ümar pool)
Miinused, vormi (2a - 0, 5) x 10 ^ -n numbrid on tavaliselt ümardatud poole võrra üles.
Autor: Patrice33740
Näiteks:
Ümar (0, 15, 1) = 0, 2
Ümar (0, 25, 1) = 0, 2
Ümar (0, 35, 1) = 0, 4
Ümar (0, 45, 1) = 0, 4
Allpool toodud ümardamisfunktsioon ei oma seda anomaalia:
Ümar (0, 15, 1) = 0, 2
Ümar (0, 25, 1) = 0, 3
Ümar (0, 35, 1) = 0, 4
Ümar (0, 45, 1) = 0, 5
Eraldi funktsioonide ring (ByVal Number, ByVal Decimal) Arrondi = Int (arv * 10 ^ Decimal + 1/2) / 10 ^ Decimal End Function