How to subtract 2 variable?

#1
{{ $maxstar := 5 }}
{{ $fillstar := .Get 0 }}
{{ $emptystar := sub $maxstar $fillstar }}
{{ range (seq $fillstar) }}
fill 
{{ end }}
{{ range (seq $emptystar) }}
empty 
{{ end }}

I got an error where i declare variable empty star

#2

This look like from a shortcode. Can you show us how you call the shortcode form your .md.

What kind of error, can you copy/paste it.

Thanks.

#3

yes it’s from shortcode the param is a string so it can’t execute the operation so I just need to convert it to string

#4

You have to show the code so we understand what is happening. Always share the error you get when seeking help.

Read Requesting Help and share more information about your issue.

#5

ok thanks!