Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using sprig function in template #78

Open
Jimmy99 opened this issue Sep 13, 2024 · 1 comment
Open

Using sprig function in template #78

Jimmy99 opened this issue Sep 13, 2024 · 1 comment
Labels
question Further information is requested

Comments

@Jimmy99
Copy link
Contributor

Jimmy99 commented Sep 13, 2024

I am trying to implement the currencyfmt sprig function in one of my page templates
I get the following error:
function "currencyfmt" not defined
when the following line in the template is executed:
<tr><td>Tax</td><td> {{currencyfmt .Data.Tax "ZAR" 2}}</td></tr>
Can anyone give me some pointers as to how the sprig functions are brought into the template within the Pagoda environment?

@mikestefanello
Copy link
Owner

The funcmap is built here. All sprig functions are included. That's initialized here and passed to the template renderer. And it's added to all compiled templates here.

I don't see currencyfmt in sprig. Are you sure that's included? Was it in a recent version and maybe you're using an older one?

@mikestefanello mikestefanello added the question Further information is requested label Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants