Commit a8ee48c6 authored by Cédric Moreau's avatar Cédric Moreau

[enh] Autoformat des prix

parent 27a20e09
......@@ -132,6 +132,21 @@ export class AnnounceService {
return
}
const that = this
// Format
for (const f of ['price', 'fees']) {
if (!this.ann[f]) {
this.ann[f] = '0.00'
}
if (this.ann[f].match(/^\d+$/)) {
this.ann[f] = this.ann[f] + '.00'
}
if (this.ann[f].match(/^\d+\.$/)) {
this.ann[f] = this.ann[f] + '00'
}
if (this.ann[f].match(/^\d+\.\d$/)) {
this.ann[f] = this.ann[f] + '0'
}
}
let raw = this.rawify(this.ann)
return co(function*() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment