Project

General

Profile

Bug #2510 » 0001-Wt-asString-even-Wt-cannot-divide-by-zero.patch

Proposed patch - Tristan Lanfrey, 12/09/2013 03:38 AM

View differences:

src/Wt/WBoostAny.C
} else if (v.type() == typeid(boost::posix_time::time_duration)) {
const boost::posix_time::time_duration& dt
= boost::any_cast<boost::posix_time::time_duration>(v);
int millis = dt.fractional_seconds()
/ ((1 << boost::posix_time::time_duration::num_fractional_digits())
/ 1000);
int millis = dt.fractional_seconds() *
::pow(10, 3 - boost::posix_time::time_duration::num_fractional_digits());
return WTime(dt.hours(), dt.minutes(), dt.seconds(), millis)
.toString(format.empty() ? "HH:mm:ss" : format);
}
(1-1/2)