import Vue from 'vue';
import { Component } from 'vue-property-decorator';
import { State } from 'vuex-class';
import View from '!view!./pricing-card.html?style=./pricing-card.styl';

import { Store } from '../../store/index';
import { currency } from '../../../lib/gj-lib-client/vue/filters/currency';

@View
@Component({
	filters: {
		currency,
	},
})
export class AppPricingCard extends Vue {
	@State sellable: Store['sellable'];
	@State price: Store['price'];
	@State originalPrice: Store['originalPrice'];

	get discount() {
		const price = this.price!;
		const originalPrice = this.originalPrice!;

		return ((originalPrice - price) / originalPrice).toFixed(0);
	}
}

import Vue from 'vue';
import { Component } from 'vue-property-decorator';
import { State } from 'vuex-class';
import View from '!view!./pricing-card.html?style=./pricing-card.styl';

import { Store } from '../../store/index';
import { currency } from '../../../lib/gj-lib-client/vue/filters/currency';

@View
@Component({
	filters: {
		currency,
	},
})
export class AppPricingCard extends Vue {
	@State
	sellable: Store['sellable'];

	@State
	price: Store['price'];

	@State
	originalPrice: Store['originalPrice'];

	get discount() {
		const price = this.price!;
		const originalPrice = this.originalPrice!;

		return (((originalPrice - price) / originalPrice) * 100).toFixed(0);
	}
}

Fix the pricing card discount percentage.
Fix the pricing card discount percentage.

It was showing 0% because it wasn't multplied by 100.
