diff --git a/JavaSource/org/unitime/timetable/gwt/client/offerings/ClassSetupTable.java b/JavaSource/org/unitime/timetable/gwt/client/offerings/ClassSetupTable.java index 724b2001e8..a254577bb3 100644 --- a/JavaSource/org/unitime/timetable/gwt/client/offerings/ClassSetupTable.java +++ b/JavaSource/org/unitime/timetable/gwt/client/offerings/ClassSetupTable.java @@ -538,9 +538,13 @@ public void onValueChange(ValueChangeEvent event) { @Override public void onValueChange(ValueChangeEvent event) { try { - line.setRoomRatio(Float.parseFloat(event.getValue())); + line.setRoomRatio((float)NumberFormat.getDecimalFormat().parse(event.getValue())); } catch (NumberFormatException e) { - line.setRoomRatio(1.0f); + try { + line.setRoomRatio(Float.parseFloat(event.getValue())); + } catch (NumberFormatException f) { + line.setRoomRatio(1.0f); + } } roomRatio.setValue(sRoomRatioFormat.format(line.getRoomRatio())); } diff --git a/JavaSource/org/unitime/timetable/gwt/client/offerings/InstrOfferingConfigTable.java b/JavaSource/org/unitime/timetable/gwt/client/offerings/InstrOfferingConfigTable.java index cc756a0a94..2d584fcf86 100644 --- a/JavaSource/org/unitime/timetable/gwt/client/offerings/InstrOfferingConfigTable.java +++ b/JavaSource/org/unitime/timetable/gwt/client/offerings/InstrOfferingConfigTable.java @@ -493,9 +493,13 @@ public void onValueChange(ValueChangeEvent event) { @Override public void onValueChange(ValueChangeEvent event) { try { - line.setRoomRatio(Float.parseFloat(event.getValue())); + line.setRoomRatio((float)NumberFormat.getDecimalFormat().parse(event.getValue())); } catch (NumberFormatException e) { - line.setRoomRatio(1.0f); + try { + line.setRoomRatio(Float.parseFloat(event.getValue())); + } catch (NumberFormatException f) { + line.setRoomRatio(1.0f); + } } roomRatio.setValue(sRoomRatioFormat.format(line.getRoomRatio())); } diff --git a/JavaSource/org/unitime/timetable/gwt/client/widgets/NumberBox.java b/JavaSource/org/unitime/timetable/gwt/client/widgets/NumberBox.java index 8deb098760..0580477411 100644 --- a/JavaSource/org/unitime/timetable/gwt/client/widgets/NumberBox.java +++ b/JavaSource/org/unitime/timetable/gwt/client/widgets/NumberBox.java @@ -25,6 +25,8 @@ import com.google.gwt.event.dom.client.KeyCodes; import com.google.gwt.event.dom.client.KeyPressEvent; import com.google.gwt.event.dom.client.KeyPressHandler; +import com.google.gwt.i18n.client.LocaleInfo; +import com.google.gwt.i18n.client.NumberFormat; /** * @author Tomas Muller @@ -36,6 +38,7 @@ public NumberBox() { setStyleName("gwt-SuggestBox"); setWidth("100px"); getElement().getStyle().setTextAlign(TextAlign.RIGHT); + final String decimalSeparator = LocaleInfo.getCurrentLocale().getNumberConstants().decimalSeparator(); addKeyPressHandler(new KeyPressHandler() { @Override public void onKeyPress(KeyPressEvent event) { @@ -54,6 +57,7 @@ public void onKeyPress(KeyPressEvent event) { } if (isDecimal() && event.getCharCode() == '.' && !getValue().contains(".")) return; + if (isDecimal() && decimalSeparator != null && event.getCharCode() == decimalSeparator.charAt(0) && !getValue().contains(decimalSeparator)) return; if (isNegative() && event.getCharCode() == '-' && !getValue().contains("-") && (getCursorPos() == 0 || getSelectionLength() == getValue().length())) return; @@ -72,6 +76,9 @@ public void onKeyPress(KeyPressEvent event) { public void setNegative(boolean negative) { iNegative = negative; } public Double toDouble() { + try { + return NumberFormat.getDecimalFormat().parse(getValue()); + } catch (NumberFormatException e) {} try { return Double.parseDouble(getValue()); } catch (NumberFormatException e) { @@ -80,6 +87,9 @@ public Double toDouble() { } public Float toFloat() { + try { + return (float) NumberFormat.getDecimalFormat().parse(getValue()); + } catch (NumberFormatException e) {} try { return Float.parseFloat(getValue()); } catch (NumberFormatException e) { diff --git a/WebContent/styles/unitime.css b/WebContent/styles/unitime.css index ada6a61f2c..ce58b96365 100644 --- a/WebContent/styles/unitime.css +++ b/WebContent/styles/unitime.css @@ -7722,8 +7722,17 @@ unitime-RoomSharingWidget .legend .blank { list-style-position: inside; } +.unitime-MultipleClassSetup .class-name { + white-space: nowrap; +} + .unitime-MultipleClassSetup .class-buttons { padding: 0px 1px 0px 1px; + white-space: nowrap; +} + +.unitime-MultipleClassSetup .class-limit { + white-space: nowrap; } .unitime-MultipleClassSetup .class-buttons div { @@ -7761,8 +7770,17 @@ unitime-RoomSharingWidget .legend .blank { margin-left: 4px; } +.unitime-InstrOfferingConfig .subpart-limit { + white-space: nowrap; +} + .unitime-InstrOfferingConfig .subpart-buttons { padding: 0px 1px 0px 1px; + white-space: nowrap; +} + +.unitime-InstrOfferingConfig .class-limit { + white-space: nowrap; } .unitime-InstrOfferingConfig .subpart-buttons div {