Forum Discussion
VikasB
8 years agoBoss
BowBharath I think in rare cases answer count may cross this limit. So you can use it
<#assign string = "Best Answer" /> <#assign bestAnswersCount = count /> <#if bestAnswersCount > 1> <#assign string = "Best Answers" /> <#elseif bestAnswersCount > 999 /> <#assign bestAnswersCount = "1k" /> <#elseif bestAnswersCount > 1999 /> <#assign bestAnswersCount = "2k" /> <#elseif bestAnswersCount > 2999 /> <#assign bestAnswersCount = "3k" /> <#else> <#assign bestAnswersCount = "3k+" /> </#if> <li class="item">${bestAnswersCount} ${string}</li>
LMK If you think it can cross it. If yes, I'll try to find you a better solution.
BowBharath
8 years agoAce
How about while loop ?
Any reference or basic coding help me do it more efficient ?
- VikasB8 years agoBoss
No, looping would not suit you here. Here is the conditional situation so have to go with 'if else'. Switch case could be the better case if there are too many 'if else' but that also would not work here also.
Related Content
- 12 years ago
- 11 years ago