This commit is contained in:
hyojun.choi 2024-06-24 14:57:30 +09:00
commit 8bb3b38fcc
2 changed files with 20 additions and 1 deletions

View File

@ -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}`
}

View File

@ -280,7 +280,7 @@ export default function Roof() {
return (
<>
<div className="flex justify-center my-8">
<div className="flex justify-center my-8 w-full">
<button
className="w-30 mx-2 p-2 rounded bg-blue-500 text-white"
onClick={addRect}