I'm having a bit of an issue converting a string to a number when pulling some JSON.
I'm not really familiar with a lot of this, so learning as I go, any help would be greatly appreciated.
I've got the result I want, which is a number. However even with number type set to float I get the following:
{"Database Name":"tempdb","Logical Name":"tempdb1","File Group":"PRIMARY","File Path":"T:\\SQLData\\tempdb.mdf","File Size (MB)":"10,240.00","Est Used (MB)":"75.06","Est Free (MB)":"10,164.94","Total Pages":"1,310,720","Total Pages (MB)":"10,240.00","Used Pages":"9,608","Used Pages (MB)":"75.06","Version Store":"488","Version Store (MB)":"3.81","User Objects":"496","User Objects (MB)":"3.88","System Objects":"7,880","System Objects (MB)":"61.56","Mixed Extents":"744","Mixed Extents (MB)":"5.81"}
I'm trying to extract various Values from this string.
My first preprocessing step looks like: $["Est Free (MB)"]
This gives me the value 10,164.94
However, I get the above mentioned error.
How would I convert this string using pre-processing into a value\number? I see an option for JavaScript to perhaps convert, but not familiar enough with it to get it working.
With appreciation,
Update: I eventually noticed the comma in my result, so I created a replacement for ","
So far this is allowing me to obtain my value.
I'm not really familiar with a lot of this, so learning as I go, any help would be greatly appreciated.
I've got the result I want, which is a number. However even with number type set to float I get the following:
- Value of type "string" is not suitable for value type "Numeric (float)". Value "10,164.94"
{"Database Name":"tempdb","Logical Name":"tempdb1","File Group":"PRIMARY","File Path":"T:\\SQLData\\tempdb.mdf","File Size (MB)":"10,240.00","Est Used (MB)":"75.06","Est Free (MB)":"10,164.94","Total Pages":"1,310,720","Total Pages (MB)":"10,240.00","Used Pages":"9,608","Used Pages (MB)":"75.06","Version Store":"488","Version Store (MB)":"3.81","User Objects":"496","User Objects (MB)":"3.88","System Objects":"7,880","System Objects (MB)":"61.56","Mixed Extents":"744","Mixed Extents (MB)":"5.81"}
I'm trying to extract various Values from this string.
My first preprocessing step looks like: $["Est Free (MB)"]
This gives me the value 10,164.94
However, I get the above mentioned error.
How would I convert this string using pre-processing into a value\number? I see an option for JavaScript to perhaps convert, but not familiar enough with it to get it working.
With appreciation,
Update: I eventually noticed the comma in my result, so I created a replacement for ","
So far this is allowing me to obtain my value.
Comment