fix(finance): portfolio template float64 comparison error
ge/lt in Go templates cannot mix float64 and untyped int literals. TotalPCLPct is float64, so replaced `ge $d.TotalPCLPct 0` with `eq (pctSign $d.TotalPCLPct) "+"` which uses the existing pctSign helper that already handles the sign check correctly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
c255d7f523
commit
2b98599bcf
@ -19,7 +19,7 @@
|
|||||||
<h2>Unrealized P&L</h2>
|
<h2>Unrealized P&L</h2>
|
||||||
<div class="value {{if ge $d.TotalPCLCents 0}}positive{{else}}negative{{end}} animate-counter"
|
<div class="value {{if ge $d.TotalPCLCents 0}}positive{{else}}negative{{end}} animate-counter"
|
||||||
data-target="{{$d.TotalPCLCents}}" data-prefix="€">€0.00</div>
|
data-target="{{$d.TotalPCLCents}}" data-prefix="€">€0.00</div>
|
||||||
<p style="font-size:13px; margin-top:6px; {{if ge $d.TotalPCLPct 0}}color:var(--green){{else}}color:var(--red){{end}};">
|
<p style="font-size:13px; margin-top:6px; color:{{if eq (pctSign $d.TotalPCLPct) "+"}}var(--green){{else}}var(--red){{end}};">
|
||||||
{{pctSign $d.TotalPCLPct}}{{printf "%.2f" $d.TotalPCLPct}}%
|
{{pctSign $d.TotalPCLPct}}{{printf "%.2f" $d.TotalPCLPct}}%
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@ -66,6 +66,7 @@
|
|||||||
{{if ge .UnrealizedPCLCents 0}}+{{else}}−{{end}}€{{cents (centsAbs .UnrealizedPCLCents)}}
|
{{if ge .UnrealizedPCLCents 0}}+{{else}}−{{end}}€{{cents (centsAbs .UnrealizedPCLCents)}}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
{{end}}
|
{{end}}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user