alpaca forms js - how to make currency field work with reverse?

114 views Asked by At

Currently on alpaca forms documentation there is no way to start with reverse option. Whatever mask I use I'm always getting the same effect.

Example 1: Type in currency "5", Field shows: "0,05", Expected behaviour: "5" or "5,00".

Example 2: Type in currency "100", Field shows: "1,00", Expected behaviour: "100" or "100,00".

Example 3 (working fine): Type in currency "1,30", Field shows: "1,30", Expected behaviour: "1,30".

1

There are 1 answers

0
Oussama BEN MAHMOUD On

Welcome to Stackoverflow,

When it comes to third party plugins like here JQuery Price Format Alpacajs have nothing to do with what you want to achieve, the documentation you should rely on is the plugin's documentation which is in http://price-format.github.io/Jquery-Price-Format/

Seeing the doc myself I couldn't find what you're looking for, however in their github repo there's a pull-request that stills on validation to fix this issue. (see https://github.com/price-format/Jquery-Price-Format/pull/85)

There's anothing plugin that might be helpful check http://www.decorplanit.com/plugin/ and see if it suits you in terms of functions and options, then you can integrate it with alpaca by creating custom field and apply it to your field.