I'm using Spring Boot and spring-web and have the following dto:
public class InstructionDto {
private Long id;
private String scanningStatus;
private LocalDate dateSubmitted;
private InstructionTypeDto type;
private InstructionStatus status;
@DecimalMax(value = "1000000000.0", message = "Amount must be less than 1000000000")
private Double amount;
private String description;
private Currency currency;
private LocalDate actionByDate;
private LocalDate dateResolved;
private LocalDate cancellationDate;
}
With amount
field of Double
type.
Whenever I try to get Instruction resource with amount
> 10000000 I get something like:
{
"id": 31,
"scanningStatus": "",
"dateSubmitted": "2020-08-17",
"type": {
"id": 1,
"name": "New Type"
},
"status": "SENT",
"amount": 1.0E8,
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean at tortor sit amet est finibus tempus. Vivamus dictum, quam in egestas mollis, nibh libero bibendum lorem, non malesuada enim risus ac risus. Fusce sed mi quis risus semper orci aliquam",
"currency": "USD",
"actionByDate": "2020-08-31",
"dateResolved": null,
"cancellationDate": null,
}
So amount
= 1.0E8
, however, I would prefer amount
=10000000
.
Is it possible to get it serialized in a proper format somehow?
Thanks