mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
default price filter currency formatter added
This commit is contained in:
parent
4365c9e8c0
commit
d2665a951a
@ -0,0 +1,8 @@
|
||||
$("input[data-type='currency']").on('blur', function() {
|
||||
const value = this.value.replace(/,/g, '');
|
||||
this.value = parseFloat(value).toLocaleString('en-US', {
|
||||
style: 'decimal',
|
||||
maximumFractionDigits: 2,
|
||||
minimumFractionDigits: 2
|
||||
});
|
||||
});
|
||||
@ -19,12 +19,14 @@
|
||||
<input type="number" class="price-input form-control w-100"
|
||||
value="{{ app.request.get('min_price') }}"
|
||||
name="min_price" min="0"
|
||||
data-type="currency"
|
||||
placeholder="{{ trans('visiosoft.module.advs::field.min.name') }}">
|
||||
</div>
|
||||
<div class="col-md-4 p-1 pr-0 m-0">
|
||||
<input class="price-input form-control w-100" type="number"
|
||||
value="{{ app.request.get('max_price') }}"
|
||||
name="max_price"
|
||||
data-type="currency"
|
||||
placeholder="{{ trans('visiosoft.module.advs::field.max.name') }}">
|
||||
|
||||
</div>
|
||||
@ -41,4 +43,5 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ asset_script('visiosoft.module.advs::js/currency_format.js') }}
|
||||
{% endif %}
|
||||
Loading…
Reference in New Issue
Block a user