简体   繁体   中英

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

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".

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM