Skip to content

Instantly share code, notes, and snippets.

@renato04
Created March 9, 2021 11:49
Show Gist options
  • Save renato04/f7173faaa1828f10efcaf111cfb05295 to your computer and use it in GitHub Desktop.
Save renato04/f7173faaa1828f10efcaf111cfb05295 to your computer and use it in GitHub Desktop.
package example;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
@RestController
public class ExampleController {
public static final BigDecimal VALUE_BIG_DECIMAL = BigDecimal.valueOf(0.081854595094424);
@GetMapping(value = "/test/bigdecimal", produces = MediaType.APPLICATION_JSON)
public ResponseEntity getBigDecimal() {
return new ResponseEntity(new Dto(VALUE_BIG_DECIMAL), HttpStatus.OK);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment