round(): Rounding to a Nearby Value
round() rounds a number to the nearest integer or requested precision. It is useful for display values, reports, and deliberately discrete calculations.
Choose a rounding rule
Tie behavior matters, so test values exactly halfway between choices when financial or regulatory results depend on it. Use floor() to always round down, ceil() to always round up, and fix() to move toward zero.
Round at the presentation boundary whenever possible. Premature rounding compounds errors in totals, ratios, and iterative calculations. Use format() when only the displayed number of digits should change.