Hello Guest it is March 28, 2024, 08:55:12 PM

Author Topic: CB formatting numbers  (Read 3231 times)

0 Members and 1 Guest are viewing this topic.

CB formatting numbers
« on: September 29, 2011, 09:26:51 AM »
How dose one format a double number for printing to a file to get
xx.0000 instead of xx.000000000000 in CBasic?
Thanks
Keith

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: CB formatting numbers
« Reply #1 on: September 29, 2011, 10:20:20 AM »
Tap= 1.11111111111111
Tap= Format(tap,"00.0000")  ' Formatting the Variable
NOW Tap=1.1111

You can also format on the fly

as   Msgbox("Tap= ") & Format("Tap,"00.0000")

The message will say  Tap= 1.1111

That is one way, (;-) TP
« Last Edit: September 29, 2011, 10:22:43 AM by BR549 »
Re: CB formatting numbers
« Reply #2 on: September 29, 2011, 11:04:20 AM »
Thanks TP, that was an easy one!  Now I will have to find a hard one for you... >:D
Keith

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: CB formatting numbers
« Reply #3 on: September 29, 2011, 12:26:51 PM »
You are lucky I am working on new screens and cool new plasma functions.  I have to use format a lot to make it all look neat.

Just wait until I don't work on them for a short while, I will forget half of it and THEN you can stump me easy enough.

BUT I did create some neat new manuals to reference. (;-)

(;-) TP
Re: CB formatting numbers
« Reply #4 on: September 29, 2011, 02:28:55 PM »
I appreciate your help and will look forward to seeing the manuals!

Keith

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: CB formatting numbers
« Reply #5 on: September 29, 2011, 02:33:24 PM »
AH the Manuals(;-) Those are the secrets of the Jedi Macherteer.

(;-) TP