Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

How to remove comma from a number in .tpl file

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Feature Requests
View previous topic :: View next topic  
Author Message
sreenivas
Smarty n00b


Joined: 24 Sep 2012
Posts: 2

PostPosted: Mon Sep 24, 2012 5:35 am    Post subject: How to remove comma from a number in .tpl file Reply with quote

Hi,
I need to remove a comma from a number which comes dynamic to template file. e.g (if a number is like 1,112. need to display 1112).
below is my code.
<td>${variableMap[key]}</td>
Back to top
View user's profile Send private message
douglassdavis
Smarty Junkie


Joined: 21 Jan 2008
Posts: 541

PostPosted: Mon Sep 24, 2012 10:59 am    Post subject: Re: How to remove comma from a number in .tpl file Reply with quote

Code:

<td>${variableMap[key]|replace:','}</td>


Last edited by douglassdavis on Fri Sep 28, 2012 12:40 pm; edited 2 times in total
Back to top
View user's profile Send private message
sreenivas
Smarty n00b


Joined: 24 Sep 2012
Posts: 2

PostPosted: Fri Sep 28, 2012 8:21 am    Post subject: Reply with quote

Hi douglassdavis,
when run below mentioned code, I am getting following error

freemarker.core.ParseException: Encountered ":"

any other solution ???
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Fri Sep 28, 2012 10:24 am    Post subject: Reply with quote

You are usingthe Java freemarker template engine, not Smarty.....
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Feature Requests All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP