st2web icon indicating copy to clipboard operation
st2web copied to clipboard

Large Number/Integer Rounding

Open skjbulcher opened this issue 6 years ago • 0 comments

The UI distorts large numbers and integers in the input field, which means re-running actions that use either will result in different input when this was not intended. Additionally, numbers are distorted during the task run. Integers seem to hold their integrity.

/test_num_param_workflow.yaml

---
name: test_num_param
pack: zoho_desk
description: Test large number handling in st2
runner_type: mistral-v2
entry_point: workflows/test_num_param.yaml
enabled: true
parameters:
    number:
        type: number
        description: number
        required: true
        position: 0
    integer:
        type: integer
        description: integer
        required: true
        position: 1
```		
		
**/workflows/test_num_param.yaml**

version: '2.0'

zoho_desk.test_num_param: description: Test number parameter handling in st2 type: direct input: - number - integer

tasks:
    run_test:
        action: core.echo
        input:
            message: <% $.number %> <% $.integer %>
				
**test result**

$ st2 run zoho_desk.test_num_param number=356686000032329832 integer=356686000032329832 .. id: 5c93b435bf1d200138025abf action.ref: zoho_desk.test_num_param parameters: integer: 356686000032329832 number: 3.5668600003232986e+17 status: succeeded result_task: run_test result: failed: false return_code: 0 stderr: '' stdout: 3.56686000032e+17 356686000032329832 succeeded: true start_timestamp: Thu, 21 Mar 2019 08:56:37 PDT end_timestamp: Thu, 21 Mar 2019 08:56:40 PDT +--------------------------+------------------------+----------+-----------+-------------------------------+ | id | status | task | action | start_timestamp | +--------------------------+------------------------+----------+-----------+-------------------------------+ | 5c93b436bf1d200138025ac2 | succeeded (1s elapsed) | run_test | core.echo | Thu, 21 Mar 2019 08:56:38 PDT | +--------------------------+------------------------+----------+-----------+-------------------------------+


**UI**
![image](https://user-images.githubusercontent.com/16672299/54767616-c73a5580-4bba-11e9-849f-7c7089a77932.png)

This issue carries itself over to the Action tab of the UI: it is impossible to run these actions from the UI with the correct number or integer:
![image](https://user-images.githubusercontent.com/16672299/54767859-4a5bab80-4bbb-11e9-92b0-d1706e5aa6be.png)

skjbulcher avatar Mar 21 '19 16:03 skjbulcher