Data field formatting & Autonumeric.js

Appframe has formatting option available when displaying and editing values.

When working with an app data-format should be specified with data-field. 

Examples: data-format="Short Date", data-format="1 234.1"

List of formats

Note: format values might be different and vary depending on user locale. Localized list could be found under user session, type in console: af.userSession.formats

        sql_date_time: "yyyy-MM-dd HH:mm:ss"
        123.1k: "0.0k"
        dd.MM.yy: "dd.MM.yy"
        1 234.1234: "0 000.0000"
        1 234.12: "0 000.00"
        *: "*"
        General Date Short Time: "dd.MM.yyyy"
        0.0%: "0.0%"
        Full Date Short Time: "dddd d. MMMM yyyy"
        dd.MMM: "dd.MMM"
        MM.yyyy: "MM.yyyy"
        $.00: "$0 000.00"
        yyyymmdd: "yyyyMMdd"
        /1000000.0: "/1000000.0"
        HH:mm: "HH:mm"
        1 234.1: "0 000.0"
        dd.MMM.yyyy: "dd.MMM.yyyy"
        1 234: "0 000"
        123.12b: "0.00b"
        Short Time: ""
        yyyy-MM-dd: "yyyy-MM-dd"
        dd.MM: "dd.MM"
        %: "0%"
        Long Time: ""
        General Date Long Time: "dd.MM.yyyy"
        dd.MM.yyyy HH:mm: "dd.MM.yyyy HH:mm"
        Long Date: "dddd d. MMMM yyyy"
        dd.MMM.yyyy HH:mm: "dd.MMM.yyyy HH:mm"
        /1000.0: "/1000.0"
        123.12k: "0.00k"
        $: "$0 000"
        dd.MM.yyyy: "dd.MM.yyyy"
        Short Date: "dd.MM.yyyy"
        123.1b: "0.0b"


We have integrated autonumeric.js library into framework which provides very good user experience when editing formatted numbers.

In order to enable this library you just need to add script into template somewhere near by all other libraries like pikaday and similar.

    @Render("SiteScript", FileName:"af.lib.autoNumeric.min.js" )

Related articles

Placeholder "LocalizeWeb2016" failed