JSON Serialize decimal places

I am serializing a class that has some Doubles. Is there a way to limit the number of decimal places when it is serialized to a JSON string?

Take a look at:

There should be a way to modify the library code.