added code that limits the string representation to only relevant digits

Please consider pulling this change.