function testFormatLongitudeMinute() { $formatter = new Coordinate_Formatter(); $this->assertIdentical('00.000', $formatter->formatLonMin(Coordinate_Coordinate::fromHemDegMin(true, 0, 0, true, 1, 0))); $this->assertIdentical('00.001', $formatter->formatLonMin(Coordinate_Coordinate::fromHemDegMin(true, 0, 0, true, 1, 0.001))); $this->assertIdentical('01.000', $formatter->formatLonMin(Coordinate_Coordinate::fromHemDegMin(true, 0, 0, true, 1, 1))); $this->assertIdentical('10.000', $formatter->formatLonMin(Coordinate_Coordinate::fromHemDegMin(true, 0, 0, true, 1, 10))); $this->assertIdentical('59.999', $formatter->formatLonMin(Coordinate_Coordinate::fromHemDegMin(true, 0, 0, true, 1, 59.999))); }
public function prepare($template) { $formatter = new Coordinate_Formatter(); $coordinate = $this->getCoordinate(); $template->assign(self::lat_hem, $formatter->formatLatHem($coordinate)); $template->assign(self::lat_deg, $formatter->formatLatDeg($coordinate)); $template->assign(self::lat_min, $formatter->formatLatMin($coordinate)); $template->assign(self::lon_hem, $formatter->formatLonHem($coordinate)); $template->assign(self::lon_deg, $formatter->formatLonDeg($coordinate)); $template->assign(self::lon_min, $formatter->formatLonMin($coordinate)); if (!$this->valid) { $template->assign(self::coord_error, $this->translator->translate('Invalid coordinate')); } }