I don't understand what you need to do.
I believe that the "f" and "d" suffixes are only needed for floating-point literals such as:
Notice that the "f" and "d" suffixes above are within the
Java source code.
I see that you are working with strings within a Document object. When you convert the strings to floating-point, I believe that it is the Java code that will determine whether the result is a double or a float, not an "f" or "d" suffix in the
String object.