MCPcopy Create free account
hub / github.com/JoaoLopesF/RemoteDebug / formatNumber

Method formatNumber

src/RemoteDebug.cpp:1839–1858  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1837// Format numbers
1838
1839String RemoteDebug::formatNumber(uint32_t value, uint8_t size, char insert) {
1840
1841 // Putting zeroes in left
1842
1843 String ret = "";
1844
1845 for (uint8_t i = 1; i <= size; i++) {
1846 uint32_t max = pow(10, i);
1847 if (value < max) {
1848 for (uint8_t j = (size - i); j > 0; j--) {
1849 ret.concat(insert);
1850 }
1851 break;
1852 }
1853 }
1854
1855 ret.concat(value);
1856
1857 return ret;
1858}
1859
1860#ifndef WEBSOCKET_DISABLED // For web socket server (app)
1861

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected