As a part of a calculator for model railroad stub switches, I developed a couple of javascript routines for input and output that allow more flexibility than the standard implementation. This function converts to text for display from a numeric value, with a variable number of decimals, removing extra trailing zeroes. It also converts the (default […]