Skip to content
Permalink
Browse files

NaN or infinite numbers are written as 'NA' into output files.

  • Loading branch information...
asishallab committed Sep 23, 2016
1 parent 48e5696 commit 75b8ac0c245e39a8a9c83162da8d47b3da67ccdd
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/ahrd/view/AbstractOutputWriter.java
@@ -23,13 +23,13 @@

/**
* Uses static final DecimalFormat FRMT to format the input double, or if
* the input is Double.NaN returns "NA"
* the input is not a number or infinite returns "NA".
*
* @param nmb
* @return String NA or the formatted double
*/
public static String formattedNumberToString(Double nmb) {
return (nmb == Double.NaN) ? "NA" : FRMT.format(nmb);
return (nmb.isNaN() || nmb.isInfinite()) ? "NA" : FRMT.format(nmb);
}

private Collection<Protein> proteins;

0 comments on commit 75b8ac0

Please sign in to comment.
You can’t perform that action at this time.