Fixed rounding of transaction form amount.
This commit is contained in:
parent
34be883b70
commit
7aded42132
|
|
@ -148,6 +148,11 @@ private class CorsHandler : HttpRequestHandler {
|
|||
} catch (HttpStatusException e) {
|
||||
response.status = e.status;
|
||||
response.writeBodyString(e.message.idup);
|
||||
} catch (Exception e) {
|
||||
import slf4d;
|
||||
error(e);
|
||||
response.status = HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
response.writeBodyString("An error occurred: " ~ e.msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ onMounted(async () => {
|
|||
*/
|
||||
async function doSubmit() {
|
||||
const localDate = new Date(timestamp.value)
|
||||
const scaledAmount = amount.value * Math.pow(10, currency.value?.fractionalDigits ?? 0)
|
||||
const scaledAmount = Math.round(amount.value * Math.pow(10, currency.value?.fractionalDigits ?? 0))
|
||||
const payload: AddTransactionPayload = {
|
||||
timestamp: localDate.toISOString(),
|
||||
amount: scaledAmount,
|
||||
|
|
|
|||
Loading…
Reference in New Issue