Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I control the output precision and format when printing a Real value?

0
Posted

How can I control the output precision and format when printing a Real value?

0

A28: All output formatting when you use the Put_To operator (<<) for built-in types is actually done by a function called To_Text. There is one version of To_Text for each argument type Boolean, Character, Integer, and Real. So, for example, the expression To_Text(true) has the Text value "1" (perhaps unexpectedly, but this is the current state of affairs (To_Text(false) is "0")); the expression To_Text('A') has the Text value "A"; the expression To_Text(17) has the Text value "17"; and the expression To_Text(3.141592) has the Text value "3.141592". If you output To_Text of an object of a built-in type, it is just the same as outputting the object directly. So both the Put_To statements below output the same thing: "125".

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123