Hey, Simon —

See my range operator:  
http://evanbalster.com/tiddlywiki/formulas.html#range%20Operator

eg.  [range[-100,100,.5]] produces -100, -99.5, -99 ... 99, 99.5, 100.

It generates evenly-spaced numbers in an arbitrary range, and can deal with 
whatever step-size you're interested in.  The numbers produced never have 
more decimal points than the arguments and the range is always inclusive.

This is a more robust and high-performance implementation than can be 
managed with TiddlyWiki's built-in mechanisms.  It's part of my math & 
formulas plugin (which I'm designing as a "universal" computation plugin) 
but it can be used separately.  See the attached JSON file.

On Thursday, 11 January 2018 08:04:06 UTC-6, Simon Huber wrote:
>
> @PMario,
>
> Am Donnerstag, 11. Januar 2018 14:26:11 UTC+1 schrieb PMario:
>>
>> On Thursday, January 11, 2018 at 1:38:33 PM UTC+1, Simon Huber wrote:
>>>
>>> negative and floating numbers with a certain limitation in accuracy 
>>> would also be great
>>>
>>
>> IMO negative numbers can be created with [addprefix[-]]
>>
>
> you're right, that works for me 
>
>>
>> floating point will be a problem. eg: 0 -> 99.99 will create about 10,000 
>> numbers. So users will create endless loops, without being aware. 
>> But you could use nested INTs.
>>
>
> that'd be ok 
>
>>
>> I was thinking about a syntax like: [create[1..100#04]] ... which would 
>> mean:
>>
>> start: 1 .. including 1
>> stop: 100 .. including 100
>>
>> format: #04 means
>>  use leading zeros
>>  use 4 digits
>>
>> which would result in 0001 ... 0100 with every number in between
>>
>> format: 1..100#03 means 001 ... 100
>>
>> format: 1..100 means 1 ... 100
>>
>> format: 33..55#03 means 033 ... 055
>>
>> and so on. 
>>
>
> I like this syntax, it would offer pretty good flexibility 
>
>>
>> Just some thoughts. No promises.
>>
>
> thanks, I can work around this with my own lists but with what you 
> proposed I imagine that all kinds of things could be made easier / possible
>
>>
>> The problem now is, that "start" stop may be variables. ... like 
>> [create<start>..<stop>#<format>] ... which is ugly, complex and the parser 
>> can't handle it at the moment.
>>
>
> I'd be totally fine with this if the parser could handle it, I'm lacking 
> ideas and knowledge tbh to propose something myself at this point
>  
> Grüße,
> Simon
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/bfe67493-9753-47b5-aacb-88e1048b32ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: $__plugins_ebalster_formula_filters_range.js.tid
Description: Binary data

Reply via email to