@@ -31,6 +31,9 @@ namespace Pebbles {
3131
3232 public static string format_result (string result ) {
3333 string output = result. replace (" ." , Utils . get_local_radix_symbol ());
34+ if (! result. contains(Utils . get_local_radix_symbol ())) {
35+ output + = Utils . get_local_radix_symbol () + " 0" ;
36+ }
3437
3538 // Remove trailing 0s and decimals
3639 while (output. has_suffix (" 0" )) {
@@ -546,37 +549,37 @@ namespace Pebbles {
546549 string output = " " ;
547550 switch (accuracy) {
548551 case 10 :
549- output = (" %.10f " . printf (result));
552+ output = (" %.10lf " . printf (result));
550553 break ;
551554 case 9 :
552- output = (" %.9f " . printf (result));
555+ output = (" %.9lf " . printf (result));
553556 break ;
554557 case 8 :
555- output = (" %.8f " . printf (result));
558+ output = (" %.8lf " . printf (result));
556559 break ;
557560 case 7 :
558- output = (" %.7f " . printf (result));
561+ output = (" %.7lf " . printf (result));
559562 break ;
560563 case 6 :
561- output = (" %.6f " . printf (result));
564+ output = (" %.6lf " . printf (result));
562565 break ;
563566 case 5 :
564- output = (" %.5f " . printf (result));
567+ output = (" %.5lf " . printf (result));
565568 break ;
566569 case 4 :
567- output = (" %.4f " . printf (result));
570+ output = (" %.4lf " . printf (result));
568571 break ;
569572 case 3 :
570- output = (" %.3f " . printf (result));
573+ output = (" %.3lf " . printf (result));
571574 break ;
572575 case 2 :
573- output = (" %.2f " . printf (result));
576+ output = (" %.2lf " . printf (result));
574577 break ;
575578 case 1 :
576- output = (" %.1f " . printf (result));
579+ output = (" %.1lf " . printf (result));
577580 break ;
578581 case 0 :
579- output = (" %.0f " . printf ( result));
582+ output = (( int ) result). to_string( );
580583 break ;
581584 default:
582585 output = result. to_string ();
0 commit comments