Add comma to separate numbers in Input Type Numeric/Decimal?

28 views
Skip to first unread message

Glen

unread,
Nov 5, 2016, 7:24:25 AM11/5/16
to Tasker
Is there a way to add comma to Numeric / Decimal?

so basically.. 1000.00 would display as 1,000.00

Robert Ryan

unread,
Nov 5, 2016, 8:37:54 AM11/5/16
to tas...@googlegroups.com

You can use Variable Search Replace as in this example.

        format number (78)
       
    A1: Variable Set
        Name: %num
        To: 1000000
        Do Maths: Off
        Append: Off
       
    A2: Variable Search Replace
        Variable: %num
        Search: (\d)(?=(\d{3})+$)
        Ignore Case: Off
        Multi-Line: Off
        One Match Only: Off
        Replace Matches: On
        Replace With: $1,
       
    A3: Flash
        Text: %num
        Long: Off

Svampsson Svampsson

unread,
Nov 5, 2016, 11:58:11 AM11/5/16
to Tasker
AutoTools has an action called AutoTools Text that has an option to format numbers in any way you like :-}

Glen

unread,
Nov 5, 2016, 2:12:38 PM11/5/16
to Tasker
Thanks for the help
But it doesnt work for me

Glen

unread,
Nov 5, 2016, 2:13:23 PM11/5/16
to Tasker
Thanks but im trying to avoid the use of plugins since I will be exporting my project as an app

Robert Ryan

unread,
Nov 5, 2016, 2:51:17 PM11/5/16
to tas...@googlegroups.com

Make sure there no spaces in the search parameter. Verify that you checked Replace Matches and that the replace parameter is $1,

I know this works here, there is no reason why it shouldn't work on your device.

Glen

unread,
Nov 6, 2016, 10:47:46 AM11/6/16
to Tasker
Oh you were right, there was a space.
Now it works. Thanks mate!

Dale Smith

unread,
Nov 7, 2016, 10:00:26 AM11/7/16
to Tasker
Very nice Bob. Few of us have the expertise to engineer that regex.
Reply all
Reply to author
Forward
0 new messages