Convert string format python
In fact this would be sufficient:
return '{0:1.3f}'.format(s)

(provided that the argument passed is a float).
There is no need for a function.
The above will return a string, if you want to return a float then use the float function:
return float('{0:1.3f}'.format(s))

Or even shorter, taking advantage of F-strings. I prefer this option personally:
return f'{s:.3f}'

Again, this returns a string but you can cast it to a float if necessary.
As a reference: Python f-string tutorial