Fix % display

This commit is contained in:
Manfred Karrer 2019-03-22 20:31:16 -05:00
parent 26fd61defb
commit 43155b8926
No known key found for this signature in database
GPG key ID: 401250966A6B2C46
2 changed files with 2 additions and 2 deletions

View file

@ -556,7 +556,7 @@ public class BSFormatter {
String input = percentString.replace("%", ""); String input = percentString.replace("%", "");
input = cleanDoubleInput(input); input = cleanDoubleInput(input);
double value = Double.parseDouble(input); double value = Double.parseDouble(input);
return value / 100d; return MathUtils.roundDouble(value / 100d, 2);
} }
public long parsePriceStringToLong(String currencyCode, String amount, int precision) { public long parsePriceStringToLong(String currencyCode, String amount, int precision) {

View file

@ -441,7 +441,7 @@ public class ProposalDisplay {
Res.get("dao.proposal.voteResult.failed"); Res.get("dao.proposal.voteResult.failed");
ProposalVoteResult proposalVoteResult = evaluatedProposal.getProposalVoteResult(); ProposalVoteResult proposalVoteResult = evaluatedProposal.getProposalVoteResult();
String threshold = (proposalVoteResult.getThreshold() / 100D) + "%"; String threshold = (proposalVoteResult.getThreshold() / 100D) + "%";
String requiredThreshold = (daoFacade.getRequiredThreshold(evaluatedProposal.getProposal()) / 100D) + "%"; String requiredThreshold = (daoFacade.getRequiredThreshold(evaluatedProposal.getProposal()) * 100D) + "%";
String quorum = bsqFormatter.formatCoinWithCode(Coin.valueOf(proposalVoteResult.getQuorum())); String quorum = bsqFormatter.formatCoinWithCode(Coin.valueOf(proposalVoteResult.getQuorum()));
String requiredQuorum = bsqFormatter.formatCoinWithCode(daoFacade.getRequiredQuorum(evaluatedProposal.getProposal())); String requiredQuorum = bsqFormatter.formatCoinWithCode(daoFacade.getRequiredQuorum(evaluatedProposal.getProposal()));
String summary = Res.get("dao.proposal.voteResult.summary", result, String summary = Res.get("dao.proposal.voteResult.summary", result,