Skip to content

Instantly share code, notes, and snippets.

@hamiltongabriel
Last active May 13, 2018 12:27
Show Gist options
  • Save hamiltongabriel/90b19d60608079da52e5c21165a0a897 to your computer and use it in GitHub Desktop.
Save hamiltongabriel/90b19d60608079da52e5c21165a0a897 to your computer and use it in GitHub Desktop.
<template>
<div>
<p>Product one cost: ${{ productOneCost | formatCost}}</p>
<p>Product two cost: ${{ productTwoCost | formatCost}}</p>
<p>Product three cost: ${{ productThreeCost | formatCost}}</p>
</div>
</template>
<script>
export default {
data: () => ({
productOneCost: 998,
productTwoCost: 2399,
productThreeCost: 5300
}),
filters:{
formatCost(value){
return '$' + (value / 100).toFixed(2);
}
}
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment