export function calculateMultiply(value1, value2, operation?): string { let result; if (value1 != null && value2 != null) { if (operation == null) { result = ((value1) * (value2)); } else if (operation != null) { result = ((value1) - (value2)); } } return result; } export function calculateDivision(value1, value2): string { let result; if (value1 != null && value2 != null) { result = ((value1) / (value2)); } return result; } export function calculateLocal(value1, value2, operation?): string { let result = ''; if (value1 != null && value2 != null) { if (operation == null) { result = (this.formatLocal((this.format(value1) * this.format(value2)))); } else if (operation != null) { result = (this.formatLocal((this.format(value1) - this.format(value2)))); } } return result; } export function formatLocal(object): string { return object.toString().replace('.', ','); } export function format(object): number { return object.toString().replace(/\./g, '').replace(',', '.'); }