Watchmaker Wiki

The ultimate watch maker for Android Wear!

User Tools

Site Tools


tips:textshortening

This is an old revision of the document!


Shorten Long Text

Examples

Limit event text to 18 characters

 string.sub('{c1t}', 1, 18)

Show ellipses after shortened event text

string.format('%-.18s%s',string.sub('{c1t}', 1, 15), string.len('{c1t}')>18 and '…' or string.sub('{c1t}',16,18))

Show event time with shortened event text and ellipses when needed

string.format('%s %-.18s%s', '{c1b}', string.sub('{c1t}', 1, 15), string.len('{c1t}')>18 and '…' or string.sub('{c1t}',16,18))

tips/textshortening.1422076948.txt.gz · Last modified: 2015/01/24 05:22 by rahul_pawa