I know i can display LISE categories hierarchy position with {$category->hierarchy}, but how do i remove the leading zeroes like 00001.00016 => 1.16?
I can use |ltrim:'0' on the first part but what about the second part after the decimal point?
Display LISE categories hierarchy position without leading zeroes Topic is solved
Re: Display LISE categories hierarchy position without leading zeroes
I don't know if this is the most efficient way, but it's an option:
Code: Select all
{$parts=explode('.', $category->hierarchy)}
{$parts[0]|ltrim:0}.{$parts[1]|ltrim:0}
Not getting the answer you need? CMSMS support options
Re: Display LISE categories hierarchy position without leading zeroes
Perfect! Thanks alot!