fix rounding on new shopping list

This commit is contained in:
smilerz
2021-12-15 14:42:12 -06:00
parent 8f19ab6e5e
commit 963dad39e8
3 changed files with 10 additions and 8 deletions

View File

@@ -308,13 +308,13 @@ else:
# SQLite testing DB # SQLite testing DB
# DATABASES = { # DATABASES = {
# 'default': { # 'default': {
# 'ENGINE': 'django.db.backends.sqlite3', # 'ENGINE': 'django.db.backends.sqlite3',
# 'OPTIONS': ast.literal_eval(os.getenv('DB_OPTIONS')) if os.getenv('DB_OPTIONS') else {}, # 'OPTIONS': ast.literal_eval(os.getenv('DB_OPTIONS')) if os.getenv('DB_OPTIONS') else {},
# 'NAME': 'db.sqlite3', # 'NAME': 'db.sqlite3',
# 'CONN_MAX_AGE': 600, # 'CONN_MAX_AGE': 600,
# } # }
#} # }
CACHES = { CACHES = {
'default': { 'default': {

View File

@@ -682,7 +682,6 @@ export default {
this.settings = getUserPreference() this.settings = getUserPreference()
this.delay = Number(this.settings.default_delay || 4) this.delay = Number(this.settings.default_delay || 4)
console.log(this.delay)
this.supermarket_categories_only = this.settings.filter_to_supermarket this.supermarket_categories_only = this.settings.filter_to_supermarket
if (this.settings.shopping_auto_sync) { if (this.settings.shopping_auto_sync) {
window.addEventListener("online", this.updateOnlineStatus) window.addEventListener("online", this.updateOnlineStatus)

View File

@@ -151,6 +151,9 @@ export default {
} }
} }
}) })
for (const [k, v] of Object.entries(amount)) {
amount[k] = Math.round(v * 100 + Number.EPSILON) / 100 // javascript hack to force rounding at 2 places
}
return amount return amount
}, },
formatCategory: function () { formatCategory: function () {