MCPcopy Create free account
hub / github.com/LAStools/LAStools / strToFloatDegPcFail

Function strToFloatDegPcFail

LASlib/src/lasfilter.cpp:50–65  ·  view source on GitHub ↗

convert the first number in a input string to the out float if the string ends with [d/D] or [p/P] the out value will be converted from [d]ecimal or [p]ercent unit outside of class > will be moved external soon...

Source from the content-addressed store, hash-verified

48// converted from [d]ecimal or [p]ercent unit
49// outside of class > will be moved external soon...
50BOOL strToFloatDegPcFail(const CHAR* cin, F32* out)
51{
52 if (sscanf(cin, "%f", out) == 1)
53 {
54 if ((tolower(cin[strlen(cin) - 1]) == 'd') || ((unsigned char)cin[strlen(cin) - 1] == 0xb0)) // degree, '�'
55 {
56 *out /= 360;
57 }
58 if ((tolower(cin[strlen(cin) - 1]) == 'p') || (cin[strlen(cin) - 1] == '%'))
59 {
60 *out /= 100;
61 }
62 return false;
63 }
64 return true;
65}
66
67// range check
68// outside of class > will be moved external soon...

Callers 1

parseMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected