Pretty cool, Mark!

The other direction:

\define stones() <$macrocall $name=rpn a={{$:/temp/british-weight-converter
}} b=<<rpn 2.20462 14 / >> operation=*/>

The metric weight of
<$edit-text tiddler="$:/temp/british-weight-converter" field="text" tag=
"input" size="3"/> ''kg'' is equal to:

<$wikify name=toPounds text="<$macrocall $name=rpn a=<<stones>> b=1 
operation=%/>">
<$macrocall $name=rpn a=<<stones>> b=0 precision=f/> stones <$macrocall 
$name=rpn a=<<toPounds>> b=14 operation=* decimals=1/> pounds
</$wikify>

… the shortest solution that came to my mind.

Now I need a rest (i fear dreaming about African Swallows swallowing 
ponies).

Good night!
Thomas

Am Mittwoch, 16. August 2017 21:09:38 UTC+2 schrieb Mark S.:
>
> Anachronistic weight conversion
>
> \define pounds2kgs(lbs) <<rpn $lbs$ 2.20462 / 2>>  
> \define stones2pounds()
> <$wikify name="stonelbs" text='<$macrocall $name="rpn" a=$(stones)$ b=14 
> operation="*"/>'>
>
> <$wikify name="totlbs" text='<$macrocall $name="rpn" a=<<stonelbs>> 
> b=$(pounds)$ operation="+" />'>
>
> $(name)$ weighs <$macrocall $name=pounds2kgs lbs=<<totlbs>>/> kgs
>
> </$wikify>
> </$wikify>
>
> \end
> !! Anachronistic Weight Calculator
> Name of person: <$edit-text tiddler="temp/stone/person" tag="input" 
> size=50 default="Enter Name"/><br/>
> Weight, stones: <$edit-text tiddler="temp/stone/stones" tag="input" 
> size=10 placeholder="Weight in stones" default="0"/><br/>
> Weight, pounds: <$edit-text tiddler="temp/stone/pounds" tag="input" 
> size=10 placeholder="Weight in pounds" default="0"/>
>
> <$vars name={{temp/stone/person}} stones={{temp/stone/stones}} 
> pounds={{temp/stone/pounds}}>
>
> <<stones2pounds>>
>
> </$vars>
>
>
>
>
>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
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/195560a8-766b-49d8-ac05-dea2361f2f84%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to