Skip to content

Commit

Permalink
Allow conversion of float to int and vice versa in TOML parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
pprcht committed Oct 10, 2024
1 parent a71e303 commit 5467bdf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/parsing/parse_toml.F90
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,10 @@ subroutine parse_tomlf_kv_normal(table,key,typ,kv)
call get_value(table,key,kv%value_b)
case (valuetypes%int)
call get_value(table,key,kv%value_i)
kv%value_f = real(kv%value_i)
case (valuetypes%float)
call get_value(table,key,kv%value_f)
kv%value_i = nint(kv%value_f)
case (valuetypes%string)
call get_value(table,key,kv%value_c)
end select
Expand Down

0 comments on commit 5467bdf

Please sign in to comment.