Skip to content

Prefix / suffix not working correctly if numbers or special characters used #58

Closed
@Dakri

Description

@Dakri

Using <VueNumberFormat v-model="testVal" v-bind="{ precision: 3, prefix: '1$=', suffix: '', decimal: ',', separator: '.' }"> </VueNumberFormat>

Results in the outcome to be unpredictable calculated value because the 1 in the prefix gets parsed to a number
also trying to add for example prefix :'+49-' results in a regex issue:
SyntaxError: Invalid regular expression: /+49-|/g: Nothing to repeat (at index.mjs:6:636)

i would suggest to simply escape the string before regexing it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions