0.0.9 • Published 1 year ago

@yes-chef/input-format v0.0.9

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

README: Using Attributes in Webflow

Overview

This guide provides instructions on how to use specific attributes in Webflow to apply currency and percentage formatting without any coding.

Add this script to the HEAD of your webflow site settings or page settings

<script defer src="https://cdn.jsdelivr.net/npm/@yes-chef/input-format@0.0.8/dist/index.js"></script>

Attributes

  • currency: This attribute specifies the type of currency symbol you want to display with an input value. It uses the currencyCalc function to apply formatting.
  • percent: This attribute is used to format input values as percentages. It uses the percentFormat function to append a percentage symbol and handle input formatting.

Supported Currencies

The following is a list of supported currencies and their corresponding attribute values:

CurrencyAttribute Value
U.S. Dollardollar
Euroeuro
British Poundpound
Japanese Yenyen
Chinese Yuanyuan
Swiss FrancswissFranc
Canadian Dollarcad
Australian Dollaraud
New Zealand Dollarnzd
Korean Wonwon
Russian Rubleruble
Indian Rupeerupee
South African Randrand
Brazilian Realreal
Philippine Pesopeso
Turkish Liralira
Swedish Kronakrona
Indonesian Rupiahrupiah
Thai Bahtbaht
Polish Złotyzloty

How to Use

  1. Currency Formatting:

    1. Add an input element in your Webflow project.
    2. Set the attribute name as currency and the value as the desired currency type (e.g., dollar, euro). The value should match one of the currency symbols listed above.
    3. When a user types into this input, the value will automatically be formatted with the appropriate currency symbol.
  2. Percentage Formatting:

    1. Add an input element in your Webflow project.
    2. Set the attribute name as percent.
    3. When a user types into this input, the value will automatically be formatted as a percentage.

Note

Ensure that the provided scripts are linked or embedded in your Webflow project for these attributes to function correctly. If a currency symbol is not recognized, it will default to the U.S. Dollar symbol.

0.0.3

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.2

2 years ago

0.0.1

2 years ago