FastLED 3.9.15
Loading...
Searching...
No Matches

◆ format_string()

fl::string fl::format_detail::format_string ( const char * value,
const FormatSpec & spec )
inline

Definition at line 284 of file format.h.

284 {
285 if (!value) value = "(null)";
286
287 fl::string str(value);
288
289 // Apply precision as max length for strings
290 if (spec.precision >= 0 && static_cast<fl::size>(spec.precision) < str.size()) {
291 str = fl::string(value, static_cast<fl::size>(spec.precision));
292 }
293
294 return str;
295}
constexpr int type_rank< T >::value

References fl::format_detail::FormatSpec::precision, fl::basic_string::size(), and fl::type_rank< T >::value.

Referenced by fl::format_detail::FormatArg::format().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: