Orit
Active member
Hi
How can I display a number variable as a 'simple' number in a template?
Example code:
	
	
	
		
i.e. instead of displaying the $cost variable as 
Is there a built in function I can use, or only use JavaScript?
I found this post:
	
	
But can't figure out how to use the functions (and if they are any use to me...)
Thanks!
				
			How can I display a number variable as a 'simple' number in a template?
Example code:
		HTML:
	
	{{ $cost ? $cost : phrase('free') : }}
	5.00 USD I'd like to simply display[COLOR=hsl(var(--xf-editorFocusColor))] [/COLOR]5.Is there a built in function I can use, or only use JavaScript?
I found this post:
Have a look in src/XF/Template/Templater.php
	
	
	
		
		PHP:
	
	protected $defaultFilters = [
        'default'          => 'filterDefault',
        'censor'           => 'filterCensor',
        'count'            => 'filterCount',
        'currency'         => 'filterCurrency',
        'emoji'            => 'filterEmoji',
        'escape'           => 'filterEscape',
        'for_attr'         => 'filterForAttr',
        'file_size'        => 'filterFileSize',
        'first'            => 'filterFirst',
        'format'           => 'filterFormat',
        'hex'              => 'filterHex'...
	Thanks!