Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

scan

26 views
Skip to first unread message

DrS

unread,
Jun 12, 2013, 4:49:01 PM6/12/13
to
Consider this:

% scan "0.00001" %f a
% set a
1e-5

Is it possible to get a numeric representation out of scan like 0.00001?
Changing tcl_precision does not change the result format.

DrS



Uwe Klein

unread,
Jun 12, 2013, 5:02:18 PM6/12/13
to
format %f $a

% format %f $a
0.000010
% format %1f $a
0.000010
% format %1.5f $a
0.00001

see man n format.

uwe

Arjen Markus

unread,
Jun 13, 2013, 2:57:38 AM6/13/13
to
Op woensdag 12 juni 2013 22:49:01 UTC+2 schreef DrS het volgende:
Actually, 1e-5 is an example of a very common numerical representation.
As Uwe notes, you can use [format] to change the default representation,
more accurately, change the string representation of the number.

(This form is chosen on the basis of a set of heuristic rules, since you
did not specify how you wanted the number to be converted to a string ;))

Regards,

Arjen
0 new messages