format the rate in the plan model
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
import computed from "ember-addons/ember-computed-decorators";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
|
||||
const Plan = Discourse.Model.extend({});
|
||||
const Plan = Discourse.Model.extend({
|
||||
@computed("amount", "currency", "interval")
|
||||
subscriptionRate(amount, currency, interval) {
|
||||
const dollars = parseFloat(amount / 100).toFixed(2);
|
||||
return `$${dollars} ${currency.toUpperCase()} / ${interval}`;
|
||||
},
|
||||
});
|
||||
|
||||
Plan.reopenClass({
|
||||
findAll() {
|
||||
|
||||
Reference in New Issue
Block a user