Fix license output, tweak CleanFloat function to handle numbers over 1 million

This commit is contained in:
Brady Wetherington 2021-09-28 19:10:25 -07:00
parent f3338667c7
commit ae466be153
2 changed files with 4 additions and 3 deletions

View file

@ -31,7 +31,8 @@ class LicensesTransformer
'purchase_date' => Helper::getFormattedDateObject($license->purchase_date, 'date'), 'purchase_date' => Helper::getFormattedDateObject($license->purchase_date, 'date'),
'termination_date' => Helper::getFormattedDateObject($license->termination_date, 'date'), 'termination_date' => Helper::getFormattedDateObject($license->termination_date, 'date'),
'depreciation' => ($license->depreciation) ? ['id' => (int) $license->depreciation->id,'name'=> e($license->depreciation->name)] : null, 'depreciation' => ($license->depreciation) ? ['id' => (int) $license->depreciation->id,'name'=> e($license->depreciation->name)] : null,
'purchase_cost' => e($license->purchase_cost), 'purchase_cost' => Helper::formatCurrencyOutput($license->purchase_cost),
'purchase_cost_numeric' => $license->purchase_cost,
'notes' => e($license->notes), 'notes' => e($license->notes),
'expiration_date' => Helper::getFormattedDateObject($license->expiration_date, 'date'), 'expiration_date' => Helper::getFormattedDateObject($license->expiration_date, 'date'),
'seats' => (int) $license->seats, 'seats' => (int) $license->seats,

View file

@ -601,8 +601,8 @@
} }
if ("{{$snipeSettings->digit_separator}}" == "1.234,56") { if ("{{$snipeSettings->digit_separator}}" == "1.234,56") {
// yank periods, change commas to periods // yank periods, change commas to periods
periodless = number.toString().replace("\.",""); periodless = number.toString().replace(/\./g,"");
decimalfixed = periodless.replace(",","."); decimalfixed = periodless.replace(/,/g,".");
} else { } else {
// yank commas, that's it. // yank commas, that's it.
decimalfixed = number.toString().replace(",",""); decimalfixed = number.toString().replace(",","");