0

In similar posts, I've seen Django mentioned, but it uses curly brackets and not <>

I have a variable that is displaying numbers like:

10.0000

I am trying to get it to display the equivalent of number_format() in PHP - but I don't know what language this is to achieve it.

<%= number_format(variable,2); %>

was not successful. Nothing in the error logs saying why/what was wrong, the page just broke.

For reference, when I view the source code of the page I see this code raw, it doesn't obfuscate like PHP does.

3
  • The percent signs look like ASP -- your question is vague, how do you not know what language to use for that formatting, but you are still running the page somehow? Commented Jan 12, 2017 at 23:07
  • well yes, but we cant see your code, and while template X may use that structure so may template z,d,e,ty,u and Y so no one can know which it is. Also it may not be any open source template library at all Commented Jan 12, 2017 at 23:08
  • I posted a code sample in the title. As I mentioned in a previous comment, the tpl file came in an existing code system. It isn't something I wrote. Commented Jan 12, 2017 at 23:14

3 Answers 3

1

It's http://www.embeddedjs.com/ thanks to jade template tag bracket percentage definition

I originally missed this thread as stackoverflow doesn't recognize <% as a search term. Located the thread via searx.

Sign up to request clarification or add additional context in comments.

3 Comments

I can't yet accept this as an answer. So if anyone else comes across this thread, it's this.
so not php at all then
No, I included PHP in the original question since the codebase is PHP, assuming it may be some templating type for PHP.
0

Might be Twig, it's a templating engine for PHP.

It supports the <% %> syntax and has the number_format() function

http://twig.sensiolabs.org/

1 Comment

The system uses twig for .tpl files (this code is in a .tpl file), but the others have strictly html & php in them. I used searx and found this thread: stackoverflow.com/questions/28256371/…
0

Could be twig as mentioned above, is the common .erb syntax in ruby.

1 Comment

@RiggsFolly, he mentions Django in his original question and asks what templating language uses <%= %>. Django is python, embedded ruby isn't really out of the question here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.