Quantcast
Channel: First steps - JuliaLang
Viewing all articles
Browse latest Browse all 2795

Convert a percentage string (e.g. "99.8%") to Float64 when extracting data from CSV

$
0
0

Hi,

Does anyone know if there is a possible way to convert a percentage from a string to a Float64 when extracting data from a CSV. Or is the only way to convert the data to decimal format in excel before pulling through to Julia?

I have tried using the parse function, but that doesn’t work.

As a simplification, I have replaced the CSV extract with the raw string to help visualise:

parse(Float64, “99.8%”) which produces the error ArgumentError: cannot parse “99.8%” as Float64*

Thanks,
Alex

20 posts - 12 participants

Read full topic


Viewing all articles
Browse latest Browse all 2795

Trending Articles