Trim and Count the Decimals In this challenge, you will write a program to output how many decimal places are in the input string and trim the input if needed.

Examples

-12.32
2

32
0

3231.432
3

-34.0
0 -34

023
0 23

00324.230
2 324.23

10
0

00.3
1 0.3

0
0

-04.8330
3 -4.833


Rules


Input will be a string which can be taken through, STDIN, function arguments or the closest equivalent
Output can be through function return, STDOUT, or the closest equivalent.
There is no limit on the size for the input integer except for your languages maximum string length.
If the input has any unnecessary (leading or trailing) zeros:


You should take them out
Output the amount of decimal place in the new number
Output the new number separated by a separator (e.g. space, newline, comma)

Input will always match this RegEx: -?\d+(\.\d+)?, or if you don't speak RegEx:


There could be a - at the beginning implying a negative number. Then there will be at least one digit. Then there could be... a . and some more digits.
To check if an input is valid, check here

No Regex




This is code-golf so shortest code in bytes wins
Python 2, 165 180 bytes

At first I was thinking about writing my first Pyth program, got it to count the digits after the potential comma. But then I got quite annoyed, I don't know how you'd enjoy that language, guess it's just for winning purposes. Anyway here's my solution (edited since it didn't work for large numbers):

def t(i):
 o,a='',i
 while a[-1]=='0':
  a=a[:-1]
 while a[0]=='0':
  a=a[1:]
 if a[-1]=='.':a=a[:-1]
 if'.'in a:o=str(len(a)-a.index('.')-1)
 else:o='0'
 if a!=i:o+=" "+a
 print o


In case anybody wants to build on my work in Pyth: ~b@+cz"."" "1Wq@b_1"0"~b&lt;b_1)plrb6 To see where you're at, you might want to insert a p between @+.