Method code for $float.round_to()

[Turn off line numbering]
  1: arg float, places;
  2: var place_value;
  3: 
  4: if (places < 1 || places > 6)
  5:     throw(~range, "Second argument must between 1 and 6.");
  6: place_value = powers_of_ten[places];
  7: return round(float * place_value) / place_value;

// Created 02-Nov-1998 as a part of ColdCore, see: @help Credit

Tlon