comp.lang.ada
 help / color / mirror / Atom feed
* JEWL Editbox_type output numerics
@ 2010-12-14 13:24 Rego
  2010-12-14 13:39 ` Dmitry A. Kazakov
  2010-12-14 14:41 ` Jeffrey Carter
  0 siblings, 2 replies; 3+ messages in thread
From: Rego @ 2010-12-14 13:24 UTC (permalink / raw)


Hi,
I have a JEWL editbox_type which I want to output a float number in a
0.00 format (instead of exponencial 0.0e0 format). The default way
(which shows exponencial) is to do
Set_Text (My_Editbox, Float'Image (My_Float)),
so but how do I do this the other way?
Tkx



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: JEWL Editbox_type output numerics
  2010-12-14 13:24 JEWL Editbox_type output numerics Rego
@ 2010-12-14 13:39 ` Dmitry A. Kazakov
  2010-12-14 14:41 ` Jeffrey Carter
  1 sibling, 0 replies; 3+ messages in thread
From: Dmitry A. Kazakov @ 2010-12-14 13:39 UTC (permalink / raw)


On Tue, 14 Dec 2010 05:24:27 -0800 (PST), Rego wrote:

> I have a JEWL editbox_type which I want to output a float number in a
> 0.00 format (instead of exponencial 0.0e0 format). The default way
> (which shows exponencial) is to do
> Set_Text (My_Editbox, Float'Image (My_Float)),
> so but how do I do this the other way?

Output into a string and then send the string to JEWL.

In one step you can do this with:

   http://www.dmitry-kazakov.de/ada/strings_edit.htm#6

e.g.

   with Strings_Edit.Floats; use Strings_Edit.Floats;
...
   Set_Text (My_Editbox, Image (My_Float, AbsSmall => -2))

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: JEWL Editbox_type output numerics
  2010-12-14 13:24 JEWL Editbox_type output numerics Rego
  2010-12-14 13:39 ` Dmitry A. Kazakov
@ 2010-12-14 14:41 ` Jeffrey Carter
  1 sibling, 0 replies; 3+ messages in thread
From: Jeffrey Carter @ 2010-12-14 14:41 UTC (permalink / raw)


On 12/14/2010 06:24 AM, Rego wrote:
> Hi,
> I have a JEWL editbox_type which I want to output a float number in a
> 0.00 format (instead of exponencial 0.0e0 format). The default way
> (which shows exponencial) is to do
> Set_Text (My_Editbox, Float'Image (My_Float)),
> so but how do I do this the other way?

Within the language, you use an instantiation of Ada.Text_IO.Float_IO to put the 
value to a string, then pass (something derived from) that string to Set_Text.

Or you can use a library such as the PragmAda Reusable Components; see 
PragmARC.Images:

http://pragmada.x10hosting.com/

-- 
Jeff Carter
"From this day on, the official language of San Marcos will be Swedish."
Bananas
28



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-12-14 14:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-14 13:24 JEWL Editbox_type output numerics Rego
2010-12-14 13:39 ` Dmitry A. Kazakov
2010-12-14 14:41 ` Jeffrey Carter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox