Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

Commit

Permalink
fix rounding error
Browse files Browse the repository at this point in the history
  • Loading branch information
monty5811 committed Nov 4, 2016
1 parent 7e8dea6 commit 35e5562
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
20 changes: 10 additions & 10 deletions apostello/static/js/app.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions apostello/static/js/groupcomposer.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apostello/templates/apostello/send_adhoc.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{% csrf_token %}
{{ form|semanticui }}
<div id="dtBox"></div>
<button type="submit" class="ui primary button" id='#send'>Send ($0)</button>
<button type="submit" class="ui primary button" id='#send'>Send ($0.00)</button>
</form>
{% endblock %}
{% block morejs %}
Expand Down
2 changes: 1 addition & 1 deletion apostello/templates/apostello/send_group.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{% csrf_token %}
{{ form|semanticui }}
<div id="dtBox"></div>
<button type="submit" class="ui primary button" id='#send'>Send ($0)</button>
<button type="submit" class="ui primary button" id='#send'>Send ($0.00)</button>
</form>
{%endblock%}
{% block morejs %}
Expand Down
2 changes: 1 addition & 1 deletion assets/js/utils/calculate_sms_cost.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import $ from 'jquery';
export default function setCost(nPeople, sCost) {
const smsLength = $('#id_content')[0].value.length;
const nSms = Math.ceil(smsLength / 160);
const cost = `$${nPeople * nSms * sCost}`;
const cost = `$${(nPeople * nSms * sCost).toFixed(2)}`;
document.getElementById('#send').innerHTML = `Send (${cost})`;
}

0 comments on commit 35e5562

Please sign in to comment.