mirror of
https://github.com/taigrr/wtf
synced 2026-03-26 19:02:18 -07:00
WTF-897 Exchange Rate improvements
Allows the user to set the precision for their exchange rate values. Config setting: ``` exchangerates: precision: 3 ``` Default is `7`. Also aligns converted values along the decimal place for improved aesthetics. Signed-off-by: Chris Cummer <chriscummer@me.com>
This commit is contained in:
@@ -15,6 +15,8 @@ const (
|
||||
type Settings struct {
|
||||
common *cfg.Common
|
||||
|
||||
precision int `help:"How many decimal places to display." optional:"true"`
|
||||
|
||||
rates map[string][]string `help:"Defines what currency rates we want to know about"`
|
||||
order []string
|
||||
}
|
||||
@@ -24,6 +26,8 @@ func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *co
|
||||
settings := Settings{
|
||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||
|
||||
precision: ymlConfig.UInt("precision", 7),
|
||||
|
||||
rates: map[string][]string{},
|
||||
order: []string{},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user