Converting strings to double
in
Programming Questions
•
24 days ago
Hi, new to processing.
I am trying to convert user input using strings into double. Any ideas on house to do this?
Or is there a better way to accept user input?
double user_temp;
double user_wind_speed;
PFont f;
// Variable to store text currently being typed
String typing = "";
// Variable to store saved text when return is hit
String saved = "";
void setup() {
size(600,450);
f = createFont("Arial",15,true);
}
void draw() {
background(255);
int indent = 25;
// Set the font and fill for text
textFont(f);
fill(0);
// Display everything
text("Click in this box and start entering the values. \nHit return to save what you typed. \n Enter the Air Temperature:", indent, 40);
text(typing,indent,100);
text(saved,indent,130);
Thanks.
1