Handle simple to complex math operations

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ReudsFratt92
func _on_LineEdit_text_changed(new_text):
	$Container/Label2.text = solve_the_eq(new_text)
	
func solve_the_eq(input):
	return #*solved eq*

so, let’s say I typed 3+5. I want solve_the_eq() to return 7. Do I have to handle math manually, or is there a more adequate way?

thank you

I think “adequate” for 3+5 will be 8.

sash-rc | 2022-01-20 18:55