Scientific Notation

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Darkerzap

So I tried to figure this out with some google searches but I’m just lost.
I want to output the numbers in my labels in scientific notation. I only found 2 or 3 explanations but unfortunately I couldn’t understand them or they weren’t explained well enough. Maybe someone out there could help me out. Here is the code I’m currently using for my game.
This is the main code

extends Node2D

func t(time):
return get_tree().create_timer(time)

func _ready():
#Sets the Superhero Progress bar when swapping back to Game Screen
$Superhero/SupheroProgress.set_value(Global.value)

func _process(_delta):
#Displays Wasted Time at the top of the Game Screen
$Label.split
$Label.text = "Wasted Time: " + str(Global.WastedTimeTotal)
#Allows the Superhero Progress to increase
Global.value = $Superhero/SupheroProgress.get_value()



#Resets Superhero Progress to 0 when bar is full and disables the
#Superhero Button until process is done
if $Superhero/SupheroProgress.get_max() == Global.value :
	$Superhero/SupheroButton.disabled = true
	yield(get_tree().create_timer(.05), "timeout")
	$Superhero/SupheroProgress.set_value(0)
	$Superhero/SupheroButton.disabled = false

func Suphero_Button_Pressed():
#This adds Wasted Time for each click of the Suphero Button
Global.WastedTimeTotal = Global.WastedTimeTotal + Global.WT_Per_Superhero_Click
#Sets the value of the Superhero Progress bar to + “1” for each click
$Superhero/SupheroProgress.set_value(Global.value+Global.WT_Per_Superhero_Click)

#Switches to Upgrades Screen
func _on_Upgrades_pressed():
Global.goto_scene(“res://Game Screen/Upgrades.tscn”)

#Switches to Upgrade Screen
func _on_Microtransactions_pressed():
Global.goto_scene(“res://Game Screen/Microtransaction.tscn”)

and here is my global with some variables

extends Node2D

var WastedTimeTotal:float = 0
var WT_Per_Superhero_Click:float = 1e10
var timer
var value:float = 0
var SuperheroIncrease:float = 1
var current_scene = null

func _ready():
var root = get_tree().get_root()
current_scene = root.get_child(root.get_child_count() - 1)

func goto_scene(path):
# This function will usually be called from a signal callback,
# or some other function in the current scene.
# Deleting the current scene at this point is
# a bad idea, because it may still be executing code.
# This will result in a crash or unexpected behavior.

# The solution is to defer the load to a later time, when
# we can be sure that no code from the current scene is running:

call_deferred("_deferred_goto_scene", path)

func _deferred_goto_scene(path):
# It is now safe to remove the current scene
current_scene.free()

# Load the new scene.
var s = ResourceLoader.load(path)

# Instance the new scene.
current_scene = s.instance()

# Add it to the active scene, as child of root.
get_tree().get_root().add_child(current_scene)

# Optionally, to make it compatible with the SceneTree.change_scene() API.
get_tree().set_current_scene(current_scene)