actualtap-py icon indicating copy to clipboard operation
actualtap-py copied to clipboard

Issue with amount format

Open rodriguestiago0 opened this issue 1 year ago • 2 comments
trafficstars

Can we allow different time zones to allow different formats.

"msg": "Input should be a valid decimal",
"input": "23,27"

rodriguestiago0 avatar Nov 06 '24 22:11 rodriguestiago0

Can I have an example of the payload that is expected for the api?

rodriguestiago0 avatar Nov 06 '24 23:11 rodriguestiago0

You can find the function with its validator here. Here's the code block:

    def validate_amount(cls, v):
        try:
            return Decimal(str(v)) if v else Decimal(0)
        except Exception:
            raise ValueError("Invalid amount format. Must be a valid decimal number.")

From what I can tell in the iOS shortcut actions it grabs the dictionary from shortcut input, replaces [^\d.,] with World for the value with the key of amount, then gets the numbers from the amount text. So it should look for both periods and commas. Is your original message in this issue the full error message? Was there more in the payload?

Normanras avatar Jan 23 '25 14:01 Normanras

Comma separated numbers should be working

See:

https://github.com/bobokun/actualtap-py/blob/f85101958df2d9a1b135845c21de9d7531619b14/tests/test_schemas.py#L41-L44

bobokun avatar Jul 27 '25 12:07 bobokun