[mathic] 49/62: Same thing as last commit, now with ColumnPrinter::percent.
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Wed Apr 1 11:36:23 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch master
in repository mathic.
commit 265a6f50d2af318ef2655464702f95b668f24abb
Author: Bjarke Hammersholt Roune <bjarkehr.code at gmail.com>
Date: Tue Feb 5 13:32:29 2013 +0100
Same thing as last commit, now with ColumnPrinter::percent.
---
src/mathic/ColumnPrinter.cpp | 10 +++++-----
src/mathic/ColumnPrinter.h | 8 ++++----
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/mathic/ColumnPrinter.cpp b/src/mathic/ColumnPrinter.cpp
index 90a3023..a20e3ef 100755
--- a/src/mathic/ColumnPrinter.cpp
+++ b/src/mathic/ColumnPrinter.cpp
@@ -170,25 +170,25 @@ namespace mathic {
return str;
}
- std::string ColumnPrinter::percent(
+ std::string ColumnPrinter::percentInteger(
const unsigned long long numerator,
const unsigned long long denominator
) {
return ratioInteger(numerator * 100, denominator) + '%';
}
- std::string ColumnPrinter::percent(
+ std::string ColumnPrinter::percentDouble(
const double numerator,
const double denominator
) {
return ratioDouble(numerator * 100, denominator) + '%';
}
- std::string ColumnPrinter::percentFixed(
+ std::string ColumnPrinter::percentIntegerFixed(
const unsigned long long numerator,
const unsigned long long denominator
) {
- auto str = percent(numerator, denominator);
+ auto str = percentInteger(numerator, denominator);
const size_t maxSize = 6;
MATHIC_ASSERT(maxSize == std::string("100.0%").size());
const auto size = str.size();
@@ -197,7 +197,7 @@ namespace mathic {
return std::string(maxSize - str.size(), ' ') + std::move(str);
}
- std::string ColumnPrinter::percent(const double ratio) {
+ std::string ColumnPrinter::percentDouble(const double ratio) {
return oneDecimal(ratio * 100) + '%';
}
diff --git a/src/mathic/ColumnPrinter.h b/src/mathic/ColumnPrinter.h
index 3c4419a..38ad15a 100755
--- a/src/mathic/ColumnPrinter.h
+++ b/src/mathic/ColumnPrinter.h
@@ -41,20 +41,20 @@ namespace mathic {
static std::string withSIPrefix(unsigned long long l);
/** returns (3,100) as "3.0%". */
- static std::string percent(
+ static std::string percentInteger(
unsigned long long numerator,
unsigned long long denominator
);
- static std::string percent(double numerator, double denominator);
+ static std::string percentDouble(double numerator, double denominator);
/** returns (3,100) as " 3.0%". The string always has the same length for
ratios equal to or less than 999.9%. */
- static std::string percentFixed(
+ static std::string percentIntegerFixed(
unsigned long long numerator,
unsigned long long denominator);
/** returns 0.7565 as "75.7%". */
- static std::string percent(double ratio);
+ static std::string percentDouble(double ratio);
/** Returns (7,4) as "1.8" */
static std::string ratioInteger(
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mathic.git
More information about the debian-science-commits
mailing list