Last active
May 13, 2018 12:27
-
-
Save hamiltongabriel/90b19d60608079da52e5c21165a0a897 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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