3
$\begingroup$

How to remove the trailing ` in the following?

StringForm["Mean `1`", 2.2]

produces

Mean 2.2`
$\endgroup$
6
$\begingroup$

The ` you're seeing is the NumberMarks that Mathematica uses to print real numbers in InputForm and FullForm. You can suppress it with one of the following methods:

StringForm["Mean `1`", StandardForm[2.2]]
StringForm["Mean `1`", Style[2.2, NumberMarks->False]]

Mean 2.2

Mean 2.2

If you're not married to StringForm, you could also use Row:

Row[{"Mean ", 2.2}]

Mean 2.2

or StringTemplate:

StringTemplate["Mean `a`"] @ <|"a"->2.2|>

"Mean 2.2"

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.