package com.blocksolid.okrello.display;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by Dan Buckland on 02/12/2015.
 */
public class Scores {
    public String extractScoreFromString(String string) {
        Pattern pattern = Pattern.compile("\\[(\\d{1}\\.\\d{1})\\]");
        Matcher m = pattern.matcher(string);
        if (m.find()) {
            return m.group(1);
        } else {
            return "";
        }
    }
}

@@ -380,22 +380,30 @@
         
-return
+String score =
  m.group
@@ -407,16 +407,194 @@
 oup(1);%0A
+            double value = Double.parseDouble(score);%0A            if (value %3E 1) %7B%0A                return %221.0%22;%0A            %7D else %7B%0A                return score;%0A            %7D%0A
         
@@ -622,16 +622,17 @@
 return %22
+!
 %22;%0A     

Complete extractScoreFromString method to return "1.0" if value of score is above 1.0