Skip to content

percent input component

About

The percent input is a form input component for percent values. It handles scaling values for saving them in the database:

  • 19 becomes 0.19 when submitting the form
  • 0.19 becomes 19 when providing as preset value

The package @coders-tm/vue-number-format is used to scale clienside.

Example

Tne percent input component is usually used together with form-row.

<x-coreui::input-row
    :label="trans('bc-events-presentation::product-bundle.pages.create.sections.price.labels.vat')"
    required
    horizontal
>
    <x-coreui::in.percent
        name="product[price][vat]"
    />
</x-coreui::input-row>

The above example code looks like this: Example for currency input input component

Attributes

Name

Label

value

Required

Horizontal

Append

Prepent

Errors