mirror of
https://github.com/nocodb/nocodb.git
synced 2026-05-02 17:47:01 +00:00
use same conversion for lat long limit input into 10 digit after decimal
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
const latLongToJoinedString = (lat: number, long: number) => `${lat.toFixed(7)};${long.toFixed(7)}`
|
||||
export const convertGeoNumberToString = (val: number) => {
|
||||
return val.toFixed(10).replace(/[\.]0+$|([\.][^0]*)[0]+$/, '$1')
|
||||
}
|
||||
|
||||
export { latLongToJoinedString }
|
||||
export const latLongToJoinedString = (lat: number, long: number) => [lat, long].map((k) => convertGeoNumberToString(k)).join(';')
|
||||
|
||||
Reference in New Issue
Block a user