how can I precise number in double
    4 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Mira le
 el 3 de Nov. de 2020
  
    
    
    
    
    Editada: Ameer Hamza
      
      
 el 3 de Nov. de 2020
            Hello, 
I want to ask you how I can precise the numbers after comma
for example:
x=0.2584 
the result should be x=0.2
Please help me!
0 comentarios
Respuesta aceptada
  Ameer Hamza
      
      
 el 3 de Nov. de 2020
        
      Editada: Ameer Hamza
      
      
 el 3 de Nov. de 2020
  
      If the numbers are positive
x = 0.2584 
y = floor(x*10)/10
If both positive and negative 'x' are possible
y = sign(x)*floor(abs(x)*10)/10
0 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Logical en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!