diff --git a/src/main/java/writer2latex/util/Calc.java b/src/main/java/writer2latex/util/Calc.java index 4b173f1..ffa3c24 100644 --- a/src/main/java/writer2latex/util/Calc.java +++ b/src/main/java/writer2latex/util/Calc.java @@ -168,8 +168,8 @@ public class Calc { public static final String multiply(String sPercent, String sLength){ if (sLength.equals("0")) { return "0"; } float fPercent=getFloat(sPercent.substring(0,sPercent.length()-1),1); - float fLength=getFloat(sLength.substring(0,sLength.length()-2),1); - String sUnit=sLength.substring(sLength.length()-2); + float fLength=getFloat(sLength.replaceAll("[^0-9,.,-]", ""),1); + String sUnit=sLength.replaceAll("[0-9,.,-]", ""); return Float.toString(fPercent*fLength/100)+sUnit; }