diff --git a/src/app/util/canvas-util.js b/src/app/util/canvas-util.js index 1cd367fc..b515e9df 100644 --- a/src/app/util/canvas-util.js +++ b/src/app/util/canvas-util.js @@ -105,3 +105,22 @@ export function addDistanceTextToPolygon(polygon) { selectable: true, }) } + +/** + * + * @param {number} value + * @param {boolean} useDefault + * @param {string} delimeter + * @returns + * ex) 1,100 mm + */ +export const formattedWithComma = (value, unit = 'mm') => { + let formatterdData = value.toLocaleString('ko-KR') + if (unit === 'cm') { + formatterdData = value.toLocaleString('ko-KR') / 10 + } else if (unit === 'm') { + formatterdData = value.toLocaleString('ko-KR') / 1000 + } + + return `${formatterdData} ${unit}` +} diff --git a/src/components/Roof.jsx b/src/components/Roof.jsx index 3a90b960..d135c1f6 100644 --- a/src/components/Roof.jsx +++ b/src/components/Roof.jsx @@ -280,7 +280,7 @@ export default function Roof() { return ( <> -
+