MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / centered

Function centered

src/model/TableMultiVariableLookup.cpp:742–746  ·  view source on GitHub ↗

Helper function for printTable

Source from the content-addressed store, hash-verified

740
741 // Helper function for printTable
742 std::string centered(const std::string& original, int targetSize) {
743 // assert( targetSize >= 0 );
744 int padding = targetSize - (int)(original.size());
745 return padding > 0 ? std::string(padding / 2, ' ') + original + std::string(padding - (padding / 2), ' ') : original;
746 }
747
748 // Helper function for printTable
749 std::string centered(double val, int targetSize, unsigned int precision) {

Callers 1

printTableMethod · 0.85

Calls 2

sizeMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected