Deye 3p hybrid: fix curtailed script for whole-number limits (#33161)
This commit is contained in:
parent
e4e5c2db26
commit
022171ffde
1 changed files with 2 additions and 1 deletions
|
|
@ -311,8 +311,9 @@ render: |
|
|||
scale: 10
|
||||
{{- end }}
|
||||
script: |
|
||||
// float64 is required: a whole-number input arrives as an int literal
|
||||
// round, the watt conversion does not reproduce the written percent exactly
|
||||
p := int(limit*100/{{ maxf .maxacpower 1 }} + 0.5)
|
||||
p := int(float64(limit)*100/{{ maxf .maxacpower 1 }} + 0.5)
|
||||
if p > 100 {
|
||||
p = 100
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue