Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- setCompensation() {
- // set these variables to string, to use toFixed(2)
- let value: string;
- let zero: string;
- if (isNaN(this.campaignModel.per_view_pay) || !this.compensateV) {
- // since toFixed is converting to string, i am trying to parseFloat later.
- zero = (0).toFixed(2);
- // removes the 0 at the end here
- this.campaignModel.viewer_gain = parseFloat(zero);
- } else {
- // since toFixed is converting to string, i am trying to parseFloat later.
- value = (this.campaignModel.per_view_pay / 2).toFixed(2);
- // removes the 0 at the end here
- this.campaignModel.viewer_gain = parseFloat(value);
- }
- }
- var result = parseFloat(yourInput).toFixed(2);
Add Comment
Please, Sign In to add comment