phseven Posted September 30 Share Posted September 30 We know that the processor api and system on the script is token based but I think there is the possibility to have tokens on the back ground but render dollars to users. Like this $1 dollar is 100 cents so each token will be 1 cents 100 tokens = $1 dollar this way calculation will be easier. Is there a easy way to implement this? Quote Link to comment Share on other sites More sharing options...
Tech Support Posted September 30 Share Posted September 30 Yes, anywhere where you display tokens you have to do a template conversion like this: for example $data.tokens_required variable contains 123 number you need to divide it to 100, then format to a decimal form with 2 decimals, and finally add a dollar sign before it {{assign var="tokens_required_in_usd" value=$data.tokens_required/100|number_format:2:".":""}} {{assign var="tokens_required_in_usd" value="\$`$tokens_required_in_usd`"}} now $tokens_required_in_usd variable should contain $1.23 Quote Link to comment Share on other sites More sharing options...
phseven Posted October 1 Author Share Posted October 1 It´s $data.toekns_required or $Item.tokens_required? If I use data nothing will display Quote Link to comment Share on other sites More sharing options...
Tech Support Posted October 1 Share Posted October 1 It depends on the content where you use it. If you use it in include_list_videos_block_common.tpl, then it will be $item. If you use inside video_view block then it will be $data. The base variable is different depending on the context. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.