diff --git a/src/eval_expr.y b/src/eval_expr.y index b6ca2b05..1d0e536d 100644 --- a/src/eval_expr.y +++ b/src/eval_expr.y @@ -33,6 +33,8 @@ static double toint(double x); static void get_expr(double x); static void get_char(int c); static double rnd6(double x) {return round_to_n_digits(x, 6);} +static double rnd1(double x) {return round_to_n_digits(x, 1);} +static double rnd(double x) {return my_round(x);} struct fn { @@ -54,7 +56,9 @@ struct fn fn_array[] {"ln" , log, 0}, {"exp" , exp, 0}, {"sqrt" , sqrt, 0}, - {"round" , rnd6, 0}, + {"round6" , rnd6, 0}, + {"round1" , rnd1, 0}, + {"round" , rnd, 0}, {"pi" , NULL, 3.141592653589793}, {"e" , NULL, 2.718281828459045}, {"k" , NULL, 1.380649e-23}, diff --git a/src/scheduler.c b/src/scheduler.c index 61386312..dccb92b6 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -3119,6 +3119,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg if(force || !has_x || !xctx->modified || save(1, 0) != -1 ) { /* save(1)==-1 --> user cancel */ char win_path[WINDOW_PATH_SIZE]; int skip = 0; + if(has_x) tcleval("store_geom . [xschem get schname]"); dbg(1, "scheduler(): load: filename=%s\n", f); my_strncpy(f, abs_sym_path(f, ""), S(f)); if(!force && f[0] && check_loaded(f, win_path) &&