You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see that the convert function takes in an exchange rate as a string to create an apd.Decimal{} for the calculation.
I'd like to store a currency conversion rate to a postgres table as a numeric and be able to scan it out, without having to use the price structure which includes currency_code which wouldn't apply in this case (all though, maybe having from and to code would make sense).
Do you have a recommendation how I might do this without having to make a new version of github.com/jackc/pgx-shopspring-decimal which uses apd instead?
Maybe if there was currency.Rate as well as currency.Amount?
// Rate stores a decimal exchange rate from and to two currencies.
type Rate struct {
number apd.Decimal
fromCurrencyCode string
toCurrencyCode string
}
I essentially want to store historical rates accurately. There is an example on this page which has a rate of 0.000000671411306566403 for example:
Hello,
Thank you for this library!
I see that the convert function takes in an exchange rate as a string to create an apd.Decimal{} for the calculation.
I'd like to store a currency conversion rate to a postgres table as a numeric and be able to scan it out, without having to use the price structure which includes currency_code which wouldn't apply in this case (all though, maybe having from and to code would make sense).
Do you have a recommendation how I might do this without having to make a new version of github.com/jackc/pgx-shopspring-decimal which uses apd instead?
Maybe if there was currency.Rate as well as currency.Amount?
I essentially want to store historical rates accurately. There is an example on this page which has a rate of 0.000000671411306566403 for example:
https://documentation.sas.com/doc/en/fmscdc/5.6/fmspag/p06qd7jikhxltgn1rotrfqopiu4y.htm
The text was updated successfully, but these errors were encountered: