using DataFrames
using DecFP
final2019_ledger=Dict("debit"=>Dict("assets"=>Dict("Chequing"=>DataFrame("balance"=>8.00))))
"Chequing"=>DataFrame(
date=Vector{String}(["1 Jan 2019"]),
memo=Vector{String}(["Starting Balance"]),
debit=Vector{Dec64}([0.00]),
credit=Vector{Dec64}([0.00]),
balance=Vector{Dec64}(Dec64(final2019_ledger["debit"]["assets"]["Chequing"][end,:].balance))),
For a literal value use d64"0.00"
or Dec64("0.00")
. For values read in from a text file use
s = "0.00"
v = parse(Dec64, s)
In general you should avoid converting Float64
to decimals because the conversion may not give you the result you expect
julia> Dec128(0.1)
0.1000000000000000055511151231257827
julia> Dec128("0.1")
0.1
1 Like
Thanks, but what if I want a variable?