0

Need to take the final url segment which is in the form of group/index/1030 and format it to be 10.30 to signify a time.

Anyone know of a plugin? The only ones I've found format it as a price and assume it to be 1,030 or suchlike.

3

ExpressionEngine have a variable {last_segment} to get the last segment of URL. You can use any Math plugin like "Simple Math" (http://devot-ee.com/add-ons/simple-math) and divide that last segment by 100.

{exp:simple_math calculate="{last_segment} / 100"} 

Also, try by using PHPStringFun (http://engaging.net/products/phpstringfun) to format the number.

1
  • I ended up using the "Price Format" plugin which has an option to set a tax percentage and show the result. So just set this to 1 and it works like a charm! Thanks for the above suggestion...it came after I found this one but works too! – segovius Jan 31 '14 at 10:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.