In my REST API, which is developed using the Spring Framework, I have one Rest endpoint that takes two double values, calling Rest: http: // localhost: 8080 / restapp / events / nearby / 12.910967 / 77.599570
here, the first parameter (double data type), i.e. 12.910967, I can correctly get ie, 12.910967. But the second parameter ie, 77.599570, I can only get 77.0 data after truncating the decimal point.
my REST Backend:
@RequestMapping(value = "/nearby/{lat}/{lngi}", method = RequestMethod.GET, produces = "application/json") public List<Event> getNearByEvents(@PathVariable("lat") Double lat, @PathVariable("lngi") Double lngi, HttpServletResponse response) throws IOException
How to get double data type in REST api?
source share