Преглед на файлове

print accepted/rejected fractions as decimals instead of exact fractions

George C. Privon преди 9 месеца
родител
ревизия
89bed3cf9e
променени са 2 файла, в които са добавени 8 реда и са изтрити 4 реда
  1. 1 0
      CHANGELOG.md
  2. 7 4
      proposal_database.rkt

+ 1 - 0
CHANGELOG.md

@@ -10,6 +10,7 @@
 - combine creation and update scripts into a single file/tool
 - Modes are now specified as switches rather than as a free-form string. This change enables a more coherent/consistent method of parsing the arguments and getting program argument help (i.e., with `--help`)
 - Add `--list-open-calls` to show call information for unresolved (i.e., "submitted") proposals. This shows the number of proposals pending for each call, separated into PI'ed and Co-I'ed proposals.
+- Print fractions of proposals (in `--stats`) as decimals rather than exact fractions.
 - Various internal refactoring for simplicity and off-loading of work to SQLite engine.
 
 ## v0.2.x

+ 7 - 4
proposal_database.rkt

@@ -5,6 +5,7 @@
 (require racket/cmdline
          racket/date
          racket/list
+         racket/format
          db
          "config.rkt") ; load configuration file
 
@@ -315,13 +316,15 @@ resultdate TEXT DEFAULT '')")
   (define Naccepted (- Nprop Npending Nrejected))
   (display (number->string Naccepted))
   (display "\tproposals accepted (f=")
-  (display (number->string (/ Naccepted
-                              (- Nprop Npending))))
+  (display (~r (/ Naccepted
+                  (- Nprop Npending))
+               #:precision `(= 3)))
   (displayln " of resolved proposals).")
   (display (number->string Nrejected))
   (display "\tproposals rejected (f=")
-  (display (number->string (/ Nrejected
-                              (- Nprop Npending))))
+  (display (~r (/ Nrejected
+                  (- Nprop Npending))
+               #:precision `(= 3)))
   (displayln " of resolved proposals)."))