Well, there you go!!

Expanded to include Stephen's input. If you set $initval as 004 now, it 
will add suffixes as 005, 006...


plugin and demo. 
<https://ibnishak.github.io/Tesseract/pluginsandmacros/index.html#Action-JSONtid>

sincerely,
Riz

https://ibnishak.github.io/Tesseract/



On Monday, 19 February 2018 22:01:43 UTC+5:30, Stephan Hradek wrote:
>
>
>
> Am Montag, 19. Februar 2018 16:16:14 UTC+1 schrieb Riz:
>>
>>
>> - Performance: To correctly pad, say 00001 or 00019 etc, you need to 
>>
>
> do it like this for example:
>
> counter= ((("10"+counter)*1+1)+"").replace(/^10?/, "")
>
> Example run from webconsole:
>
> counter="007"
> "007"
> counter= ((("10"+counter)*1+1)+"").replace(/^10?/, "")
> "008"
> counter= ((("10"+counter)*1+1)+"").replace(/^10?/, "")
> "009"
> counter= ((("10"+counter)*1+1)+"").replace(/^10?/, "")
> "010"
> counter= ((("10"+counter)*1+1)+"").replace(/^10?/, "")
> "011"
> counter="098"
> "098"
> counter= ((("10"+counter)*1+1)+"").replace(/^10?/, "")
> "099"
> counter= ((("10"+counter)*1+1)+"").replace(/^10?/, "")
> "100"
> counter= ((("10"+counter)*1+1)+"").replace(/^10?/, "")
> "101"
> counter="998"
> "998"
> counter= ((("10"+counter)*1+1)+"").replace(/^10?/, "")
> "999"
> counter= ((("10"+counter)*1+1)+"").replace(/^10?/, "")
> "1000"
> counter= ((("10"+counter)*1+1)+"").replace(/^10?/, "")
> "1001"
>
>
>
>         
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/da1add4e-4422-4f1b-8710-ef469a8f0500%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to