Skip to content

Commit

Permalink
Update string.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreySarnoff authored Jun 11, 2019
1 parent 838d65c commit 18f2923
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/libarb/string.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,19 @@ function trimzeros(str::String)
if occursin('.', str1)
str1a, str1b = String.(split(str1, '.'))
str1b = trimallzeros(str1b)
str1 = join(str1a, str1b, '.')
end
str = join(str1, str2, 'e')
if str1b === ""
str1b = "0"
end
str1 = join((str1a, str1b), '.')
end
str = join((str1, str2), 'e')
elseif occursin('.', str)
str1a, str1b = String.(split(str, '.'))
str1b = trimallzeros(str1b)
str = join(str1a, str1b, '.')
if str1b === ""
str1b = "0"
end
str = join((str1a, str1b), '.')
end
return str
end
Expand Down

0 comments on commit 18f2923

Please sign in to comment.