import GeoJSON from 'ol/format/GeoJSON'
geojson to feature
const features = new GeoJSON({ dataProjection: 'EPSG:4326', featureProjection: 'EPSG:3857' }).readFeatures(json)
feature to geojson
const features = new GeoJSON().writeFeature(json)
Class: GeoJSON
Maximum number of decimal places for coordinates. Coordinates are stored internally as floats, but floating-point arithmetic can create coordinates with a large number of decimal places, not generally wanted on output. Set a number here to round coordinates. Can also be used to ensure that coordinates read in can be written back out with the same number of decimals.
https://openlayers.org/en/latest/apidoc/module-ol_format_GeoJSON-GeoJSON.html

