mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Duplicates d4e46ee41f
but on v5
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
dc79ca94a2
commit
cce808c784
|
@ -46,7 +46,10 @@ class Helper
|
||||||
public static function formatCurrencyOutput($cost)
|
public static function formatCurrencyOutput($cost)
|
||||||
{
|
{
|
||||||
if (is_numeric($cost)) {
|
if (is_numeric($cost)) {
|
||||||
return number_format($cost, 2, '.', '');
|
if (Setting::getSettings()->digit_separator=='1.234,56') {
|
||||||
|
return number_format($cost, 2, ',', '.');
|
||||||
|
}
|
||||||
|
return number_format($cost, 2, '.', ',');
|
||||||
}
|
}
|
||||||
// It's already been parsed.
|
// It's already been parsed.
|
||||||
return $cost;
|
return $cost;
|
||||||
|
|
|
@ -146,7 +146,6 @@ class AssetPresenter extends Presenter
|
||||||
"searchable" => true,
|
"searchable" => true,
|
||||||
"sortable" => true,
|
"sortable" => true,
|
||||||
"title" => trans('general.purchase_cost'),
|
"title" => trans('general.purchase_cost'),
|
||||||
"formatter" => 'numberWithCommas',
|
|
||||||
"footerFormatter" => 'sumFormatter',
|
"footerFormatter" => 'sumFormatter',
|
||||||
], [
|
], [
|
||||||
"field" => "order_number",
|
"field" => "order_number",
|
||||||
|
|
|
@ -14,7 +14,7 @@ class AddDigitSeparatorToSettings extends Migration
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('settings', function (Blueprint $table) {
|
Schema::table('settings', function (Blueprint $table) {
|
||||||
$table->char('digit_separator')->nullable()->default('1234.56');
|
$table->char('digit_separator')->nullable()->default('1,234.56');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -414,7 +414,7 @@ Form::macro('time_display_format', function ($name = "time_display_format", $sel
|
||||||
Form::macro('digit_separator', function ($name = "digit_separator", $selected = null, $class = null) {
|
Form::macro('digit_separator', function ($name = "digit_separator", $selected = null, $class = null) {
|
||||||
|
|
||||||
$formats = [
|
$formats = [
|
||||||
'1234.56',
|
'1,234.56',
|
||||||
'1.234,56',
|
'1.234,56',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -611,6 +611,10 @@
|
||||||
var parts = value.toString().split(".");
|
var parts = value.toString().split(".");
|
||||||
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ".");
|
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ".");
|
||||||
return parts.join(",");
|
return parts.join(",");
|
||||||
|
} else {
|
||||||
|
var parts = value.toString().split(",");
|
||||||
|
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||||
|
return parts.join(".");
|
||||||
}
|
}
|
||||||
return value
|
return value
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue