Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to display a float number in scientific?
#9
@Jack - It works and is not as complicated as Pete's solution. - A saying comes to mind:

Why do it simply when one can do it complicated?   Tongue

Code: (Select All)

'Umrechnung Dezimalzahl in Exponentialschreibweise - 4. Aug. 2024
'Referenz S.263 - Print Using Formatierungssymbole

Option _Explicit

'Bei Double erscheint ein "D" statt "E"
Dim As Single x, z

Locate 2, 3
Print "Dezimalzahl in Exponentialdarstellung"
Locate 3, 3
Print "====================================="

Locate 5, 3
Input "Dezimalzahl        : ", x

Locate 6, 3
Print Using "Als Exponentialzahl: ##.##^^^^"; x

Locate 8, 3
Input "Weitere Dezimalzahl: ", z

Locate 9, 3
'5 Exponentialsymbole ^ bewirken dreistellige Ausgabe des Exponenten
Print Using "Als Exponentialzahl: ##.##^^^^^"; z

End

PS: I didn't find snprintf() in my C books, only here: snprintf()
Reply


Messages In This Thread
RE: How to display a float number in scientific? - by Kernelpanic - 08-04-2024, 09:08 PM



Users browsing this thread: 7 Guest(s)