Exemplo n.º 1
0
Unit
FormatUserDistanceSmart(fixed value, TCHAR *buffer, bool include_unit,
                        fixed small_unit_threshold, fixed precision_threshold)
{
  return FormatDistanceSmart(buffer, value, Units::GetUserDistanceUnit(),
                             include_unit, small_unit_threshold,
                             precision_threshold);
}
Exemplo n.º 2
0
static void
TestDistanceSmart(double value, Unit unit, Unit expected_unit,
                  const TCHAR *expected_output_with_unit,
                  const TCHAR *expected_output_without_unit,
                  double small_unit_threshold = 2500,
                  double precision_threshold = 100)
{
  TCHAR buffer[256];

  ok1(FormatDistanceSmart(buffer, value, unit, true, small_unit_threshold,
                          precision_threshold) == expected_unit);
  ok1(StringIsEqual(buffer, expected_output_with_unit));

  ok1(FormatDistanceSmart(buffer, value, unit, false, small_unit_threshold,
                          precision_threshold) == expected_unit);
  ok1(StringIsEqual(buffer, expected_output_without_unit));
}
Exemplo n.º 3
0
Unit
FormatUserMapScale(fixed value, TCHAR *buffer, bool include_unit)
{
  return FormatDistanceSmart(buffer, value, Units::GetUserDistanceUnit(),
                             include_unit, fixed(1000), fixed(9.999));
}