Extract a single parameter from a CSV formatted string.
CSVtoInt( const data[], item, decimals )
Extract single numeric parameter from a CSV formatted string.
data | CSV formatted string |
item | Which item to extract. The first item is 1. |
decimals | Number of decimals to extract |
Assuming the input data is properly formatted as a CSV string (comma separated), this command finds the item by count and evaluates the item as a number. If decimals is larger than 0, that number of decimals will be added, and the resulting integer multiplied by 10 for each decimal.
The integer value of the item.
new val; new csvdata{} = "123, 1234.56, \"some string\", \"more data\""; val = CSVtoInt( csvdata, 2, 3 ); // val will be 1234560