Skip to content

Commit fddd9db

Browse files
Update area formatting in index.vue to include unit 'km²' for better clarity
1 parent 2d4e2e1 commit fddd9db

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/pages/index.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ function formatArea(polygons: any) {
130130
return area >= 100_000_000_000
131131
? (area / 1000_000_000_000).toFixed(2) + ' million km²'
132132
: area / 1000_000 > 1000
133-
? (area / 1000_000).toFixed(0).replace(/\B(?=(\d{3})+(?!\d))/g, '.')
133+
? (area / 1000_000).toFixed(0).replace(/\B(?=(\d{3})+(?!\d))/g, '.') +
134+
' km²'
134135
: (area / 1000_000).toFixed(0) + ' km²'
135136
}
136137
</script>

0 commit comments

Comments
 (0)