I need to round up a number in my input field:
<b-form-input id="amount_input" type="number"
v-model="Math.ceil(form.contract.reward_cents / 100)"
:state="validate(form.contract.reward_cents)"/>
After trying Math.ceil(), I encountered an error https://i.sstatic.net/Ksw4m.png
Can anyone provide assistance on how to resolve this issue?
This is the solution I came up with:
computed: {
reward_cents () {
return Math.ceil(this.form.contract.reward_cents / 100);
},
}
<template>
<b-form-input id="amount_input" type="number" v-model="reward_cents"
:state="validate(form.contract.reward_cents)"/>
</template>