----boundary-LibPST-iamunique-1858653877_-_-
Content-type: text/plain
Dear Wojtek,
use Strings.RealToStringForm or TextMappers.WriteRealForm:
PROCEDURE (VAR f: Formatter) WriteRealForm (x: REAL; precision, minW,
expW: INTEGER; fillCh: CHAR)
Write real x. The numeral string used to represent the number is either in
fixed point or in scientific format. See also the description of
Strings.RealToStringForm.
Pre
f.rider # NIL (not explicitly checked)
precision > 0 20
0 <= minW < LEN(s) 21
-LEN(s) < expW <= 3 22
precision denotes the number of valid decimal places (usually 7 for short
reals and 16 for reals).
minW denotes the minimal length in characters. If necessary, preceding
fillCh will be inserted.
expW > 0: exponential format (scientific) with at least expW digits in the
exponent.
expW = 0: fixpoint or floatingpoint format, depending on x.
expW < 0: fixpoint format with -expW digits after the decimal point.
Numbers are always rounded to the last valid and visible digit.
Regards
Helmut
-----Ursprüngliche Nachricht-----
Von: skulski{([at]})nowhere.xy
Gesendet: Freitag, 28. Mai 2004 19:47
An: blackbox{([at]})nowhere.xy
Betreff: Numeric formatting of controls
Hi:
is there a simple way to format numerical strings displayed
in Text Fields? The default formatting of REAL numbers is hardly
useful in the current implementation of Text Field. For example,
displaying a number -5.995171696219752E-8 makes little sense
in GUI. I would rather want to format this to something like
-5.995E-8. Moreover, would be useful to perform such formatting
on the fly, without explosion of interactor variables in the code,
whose only purpose would be to reformat the variables to be shown
in the GUI.
To this end I looked at the definition of Dialog, hoping to use
either guards or notifiers to perform on-the-fly formatting.
To my dismay the definition of Dialog.Par does not allow for this,
because the internal text field is not exported. The label is exported,
and it can be changed on the fly, but the text field itself is not.
I wonder if there is a way to reformat the Text Field from the
default formatting to something more sensible.
Thank you in advance for any hints,
Wojtek
--------------------------------------------
To unsubscribe from this mailing list, send a message containing the word
"unsubscribe" to:
blackbox-request{([at]})nowhere.xy
To get a list of valid e-mail commands and instructions on their usage, send
a message containing the word "help" to the above address.
Send any problem reports or questions related to this email list to the list
owner at
owner-blackbox{([at]})nowhere.xy
Current posting policy:
a) To post you should use the same address by which you are subscribed to
the mailing list. That way, the list server will recognize you as subscriber
and forward your posting immediately, without creating any overhead.
b) If, for some reason, you cannot post from the address, by which you are
subscribed, your message will be moderated to avoid spam. Please understand
that moderation will often cause some delay, in particular over weekends or
holydays.
--------------------------------------------
To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
blackbox-request{([at]})nowhere.xy
To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.
Send any problem reports or questions related to this email list to the list owner at
owner-blackbox{([at]})nowhere.xy
Current posting policy:
a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.
b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.
----boundary-LibPST-iamunique-1858653877_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzc1xmY2hhcnNldDAgQXJpYWw7fQ0Ke1xmMVxmbW9kZXJuIENvdXJpZXIgTmV3O30NCntcZjJc
Zm5pbFxmY2hhcnNldDIgU3ltYm9sO30NCntcZjNcZm1vZGVyblxmY2hhcnNldDAgQ291cmllciBO
ZXc7fX0NCntcY29sb3J0YmxccmVkMFxncmVlbjBcYmx1ZTA7XHJlZDBcZ3JlZW4wXGJsdWUyNTU7
fQ0KXHVjMVxwYXJkXHBsYWluXGRlZnRhYjM2MCBcZjBcZnMyMCBEZWFyIFdvanRlayxccGFyDQpc
cGFyDQp1c2UgU3RyaW5ncy5SZWFsVG9TdHJpbmdGb3JtIG9yIFRleHRNYXBwZXJzLldyaXRlUmVh
bEZvcm06XHBhcg0KXHBhcg0KUFJPQ0VEVVJFIChWQVIgZjogRm9ybWF0dGVyKSBXcml0ZVJlYWxG
b3JtICh4OiBSRUFMOyBwcmVjaXNpb24sIG1pbl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