MCPcopy Index your code
hub / github.com/benfry/processing4 / parseFloatOrPercent

Method parseFloatOrPercent

core/src/processing/core/PShapeSVG.java:1486–1493  ·  view source on GitHub ↗
(String text)

Source from the content-addressed store, hash-verified

1484
1485
1486 static protected float parseFloatOrPercent(String text) {
1487 text = text.trim();
1488 if (text.endsWith("%")) {
1489 return Float.parseFloat(text.substring(0, text.length() - 1)) / 100.0f;
1490 } else {
1491 return Float.parseFloat(text);
1492 }
1493 }
1494
1495
1496 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Callers 3

parseRGBMethod · 0.95
parseUnitSizeMethod · 0.95
GradientMethod · 0.80

Calls 2

parseFloatMethod · 0.80
trimMethod · 0.45

Tested by

no test coverage detected