I have an app where i want to show timeseries data. As my data is a list of list of numbers. The field is a text field. when i try to convert into number, the negative values are lost (ie. absolute value conversion)
[-0.097]
[-0.116]
[-0.07]
[-0.1376]
[-0.0931]
When i try to convert into numbers, it becomes:
0,097
0,116
0,07
0,1376
0,0931
Hey! Yep, sounds similar to my issue a while back. When you are converting each number you need first identify if it is a negative (by a ā¦contains ā-ā argument somewhere) and then, if this condition is true, multiply your converted number by -1. Depending on how you do it, you could have two conditional steps in the conversion workflow - one runs if the ātargetā number contains ā-ā and one of it does not contain ā-ā.
How did you run the conversion workflow, I saw that you mentioned you had a custom state for it but cannot wrap my head around how to implement it into the workflow
My current expression is: ts_turnover_dev_median:item#1:split by (,) : each item converted to number
Where ts_turnover_dev_median:item#1 = [-0.0146, -0.0039, 0.0386, -0.0082, 0.034]
I canāt reproduce the issue. It works as expected for me. This is core functionality, so Iād expect lots of apps would be affected if it were broken.
Are the square brackets actually part of the text youāre running through the :converted to number operator? If so, thatās the issue. If Bubble doesnāt recognize the entire string as a number, it just plucks out what it recognizes as a number.
In fact, even if thereās white space before the negative number, Bubble doesnāt recognize the minus sign as part of the number, so itās also good practice to run the text through the :trimmed operator first.
Aha, just noticed your 2nd post before hitting reply. I think you need to insert a :trimmed operator after the :split by().