diff --git a/src/components/App.tsx b/src/components/App.tsx index 1f7c625..a382117 100755 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -135,7 +135,6 @@ export const App: React.FC = () => { ); } } - console.log("|| App: dataContextChange", values); }, [handleCaseSelectionInCodap]); useEffect(() => { diff --git a/src/components/location-tab.tsx b/src/components/location-tab.tsx index 1b22757..d98ce20 100644 --- a/src/components/location-tab.tsx +++ b/src/components/location-tab.tsx @@ -6,6 +6,14 @@ import { LocationPicker } from "./location-picker"; import "../assets/scss/location-tab.scss"; +function formatLatLng(latOrLng: number | string): string { + // Convert the number to a string with up to 2 decimal places + const formatted = Number(latOrLng).toFixed(2); + // Remove trailing zeros after the decimal point + const trimmed = formatted.replace(/(\.\d*?[1-9])0+$/, "$1").replace(/\.0+$/, ""); + return trimmed; +} + interface LocationTabProps { latitude: string; longitude: string; @@ -63,8 +71,8 @@ export const LocationTab: React.FC = ({ }; const handleLocationSelect = (selectedLocation: ILocation) => { - setLatitude(selectedLocation.latitude.toString()); - setLongitude(selectedLocation.longitude.toString()); + setLatitude(formatLatLng(selectedLocation.latitude)); + setLongitude(formatLatLng(selectedLocation.longitude)); setLocationSearch(selectedLocation.name); }; diff --git a/src/grasp-seasons/components/seasons.scss b/src/grasp-seasons/components/seasons.scss index d2374d6..d4ca422 100644 --- a/src/grasp-seasons/components/seasons.scss +++ b/src/grasp-seasons/components/seasons.scss @@ -178,9 +178,9 @@ body { border-radius: 3px; border: solid 1px rgba(23, 121, 145, 0.75); background-color: #fff; - width: 37px; + width: 45px; height: 24px; - padding: 3px 10px; + padding: 3px 6px; } } }