Display zero values in grey

This commit is contained in:
Jan Bader 2021-12-07 20:35:49 +00:00
parent 8c9c78a789
commit 5f4c5d9d51
3 changed files with 14 additions and 2 deletions

View File

@ -19,3 +19,8 @@ func (n Numeric) GetPositive() bool {
float := n.GetFloat64() float := n.GetFloat64()
return float >= 0 return float >= 0
} }
func (n Numeric) IsZero() bool {
float := n.GetFloat64()
return float == 0
}

View File

@ -1,11 +1,11 @@
{{define "amount"}} {{define "amount"}}
<span class="right {{if .GetPositive}}{{else}}negative{{end}}"> <span class="right {{if .IsZero}}zero{{else if not .GetPositive}}negative{{end}}">
{{printf "%.2f" .GetFloat64}} {{printf "%.2f" .GetFloat64}}
</span> </span>
{{end}} {{end}}
{{define "amount-cell"}} {{define "amount-cell"}}
<td class="right {{if .GetPositive}}{{else}}negative{{end}}"> <td class="right {{if .IsZero}}zero{{else if not .GetPositive}}negative{{end}}">
{{printf "%.2f" .GetFloat64}} {{printf "%.2f" .GetFloat64}}
</td> </td>
{{end}} {{end}}

View File

@ -1,3 +1,7 @@
html {
font-size: 16px;
}
#head { #head {
height:160px; height:160px;
line-height: 160px; line-height: 160px;
@ -64,3 +68,6 @@ body {
.negative { .negative {
color: #d50000; color: #d50000;
} }
.zero {
color: #888888;
}