Revision 29b2177c
b/src/gr/grnet/pithos/web/client/Pithos.java | ||
---|---|---|
77 | 77 |
import com.google.gwt.http.client.RequestException; |
78 | 78 |
import com.google.gwt.http.client.Response; |
79 | 79 |
import com.google.gwt.http.client.URL; |
80 |
import com.google.gwt.i18n.client.NumberFormat; |
|
80 | 81 |
import com.google.gwt.json.client.JSONArray; |
81 | 82 |
import com.google.gwt.json.client.JSONObject; |
82 | 83 |
import com.google.gwt.json.client.JSONParser; |
... | ... | |
375 | 376 |
statistics.add(new HTML(" (")); |
376 | 377 |
usedPercent = new HTML(); |
377 | 378 |
statistics.add(usedPercent); |
378 |
statistics.add(new HTML("%)"));
|
|
379 |
statistics.add(new HTML(")")); |
|
379 | 380 |
treeHeader.add(statistics); |
381 |
treeHeader.setCellHorizontalAlignment(statistics, HasHorizontalAlignment.ALIGN_LEFT); |
|
380 | 382 |
trees.add(treeHeader); |
381 | 383 |
|
382 | 384 |
trees.add(folderTreeView); |
... | ... | |
604 | 606 |
totalFiles.setHTML(String.valueOf(account.getNumberOfObjects())); |
605 | 607 |
usedBytes.setHTML(String.valueOf(account.getFileSizeAsString())); |
606 | 608 |
totalBytes.setHTML(String.valueOf(account.getQuotaAsString())); |
607 |
usedPercent.setHTML(String.valueOf(account.getUsedPercentage())); |
|
609 |
NumberFormat nf = NumberFormat.getPercentFormat(); |
|
610 |
usedPercent.setHTML(nf.format(account.getUsedPercentage())); |
|
608 | 611 |
} |
609 | 612 |
|
610 | 613 |
protected void createHomeContainer(final AccountResource _account, final Command callback) { |
b/src/gr/grnet/pithos/web/client/foldertree/AccountResource.java | ||
---|---|---|
259 | 259 |
} |
260 | 260 |
|
261 | 261 |
public double getUsedPercentage() { |
262 |
return 100.0 * bytesUsed / (bytesUsed + bytesRemaining);
|
|
262 |
return ((double) bytesUsed) / (bytesUsed + bytesRemaining);
|
|
263 | 263 |
} |
264 | 264 |
|
265 | 265 |
public Folder getPithos() { |
Also available in: Unified diff