Display double number with 6 digits exactly
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Askic V
el 17 de Oct. de 2022
Comentada: Askic V
el 21 de Oct. de 2022
Hello,
I would like to create a string that will contain a double number. This number should be represented with 6 digits exactly.
For example:
x = 12.45;
str_x = sprintf('The number is %f\n', x);
should output 12.4500
0 comentarios
Respuesta aceptada
Stephen23
el 19 de Oct. de 2022
sprintf('The number is %#.6g', 12.45)
sprintf('The number is %#.6g', 2)
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!