Skip to content

Commit 8ac4aee

Browse files
author
Julien Orain
committed
Update percent to double instead of int in Progress Bar
1 parent c6e92cb commit 8ac4aee

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/main/java/com/github/gwtbootstrap/client/ui/Bar.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,20 @@ public String get() {
5656
* Set bar width as a percent unit
5757
* @param percent percent
5858
*/
59-
public void setPercent(int percent) {
59+
public void setPercent(double percent) {
6060
this.getElement().getStyle().setWidth(percent, Unit.PCT);
6161
}
6262

6363
/**
6464
* Get bar width as a percent unit
6565
* @return percent
6666
*/
67-
public int getPercent() {
67+
public double getPercent() {
6868
String width = this.getElement().getStyle().getWidth();
6969
if (width == null)
7070
return 0;
7171
else
72-
return Integer.valueOf(width.substring(0, width.indexOf("%")));
72+
return Double.valueOf(width.substring(0, width.indexOf("%")));
7373
}
7474

7575
/**

src/main/java/com/github/gwtbootstrap/client/ui/ProgressBar.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ public ProgressBar(Style style) {
5353
* Set bar width as a percent unit
5454
* @param percent percent
5555
*/
56-
public void setPercent(int percent) {
56+
public void setPercent(double percent) {
5757
bar.setPercent(percent);
5858
}
5959

6060
/**
6161
* Get bar width as a percent unit
6262
* @return percent
6363
*/
64-
public int getPercent() {
64+
public double getPercent() {
6565
return bar.getPercent();
6666
}
6767

0 commit comments

Comments
 (0)