Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

chore(utils): add roundAmount helper

Ayush Soni26b4f49a9963
diff --git a/packages/utils/src/math.ts b/packages/utils/src/math.ts
index 2f9a836312..0d0316ea9a 100644
--- a/packages/utils/src/math.ts
+++ b/packages/utils/src/math.ts
@@ -15,3 +15,7 @@ export const lerp = (min: number, max: number, t: number) => {
export const inverseLerp = (min: number, max: number, value: number) => {
return (value - min) / (max - min);
};
+
+export const roundAmount = (value: number) => {
+ return Math.round(value * 100) / 100;
+};