@Override
    public Void visitFloatLiteral(final GremlinParser.FloatLiteralContext ctx) {
        if (ctx.infLiteral() != null) return visit(ctx.infLiteral());
        if (ctx.nanLiteral() != null) return visit(ctx.nanLiteral());

        final String floatLiteral = ctx.getText().toLowerCase();

        // check suffix
        final int lastCharIndex = floatLiteral.length() - 1;
        final char lastCharacter = floatLiteral.charAt(lastCharIndex);
        switch (lastCharacter) {
            case 'f':
            case 'd':
                // parse F/f as Float and D/d suffix as Double
                sb.append(floatLiteral, 0, lastCharIndex).append(lastCharacter);
                break;
            case 'm':
                // parse N/n as BigDecimal which for groovy is default for floating point numerics
                if (!floatLiteral.contains(".")) {
                    // 1g is interpreted as BigInteger, so 'g' suffix can't be used here
                    sb.append("new BigDecimal(").append(floatLiteral, 0, lastCharIndex).append("L)");
                } else {
                    sb.append(floatLiteral, 0, lastCharIndex);
                }
                break;
            default:
                // everything else just goes as specified
                sb.append(floatLiteral);
                break;
        }
        return null;
    }
Converts a Gremlin traversal string into a Groovy source code representation of that traversal with an aim at
sacrificing some formatting for the ability to compile correctly. The translations may require use of TinkerPop's
sugar syntax and therefore requires use of the {@code GremlinLoader} in the gremlin-groovy module unless you are
specifically certain that your translations will not result in the use of that syntax. If in doubt, prefer the
{@link JavaTranslateVisitor} instead.
<ul>
    <li>Normalize numeric suffixes to lower case</li>
    <li>If floats are not suffixed they will translate as BigDecimal</li>
    <li>Makes anonymous traversals explicit with double underscore</li>
    <li>Makes enums explicit with their proper name</li>
</ul>
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GroovyTranslateVisitor.java