'If my condition fulfilled, I want to hide two button/link with together. How can I do it?

This is my conditional code:- {user ? <button onClick={logout} style={{ color: "#182D36" }} className=' btn btn-light fs-6 fw-bold'> Log Out < /button> : <Nav.Link as={Link} to='login' >Login</Nav.Link> }

I also want to hide this Sign-Up link (<Nav.Link as={Link} to='register' >Sign UP</Nav.Link>) by the condition



Solution 1:[1]

just throw the signup into the condition as well...

const content = user ? 
<button onClick={logout} style={{ color: "#182D36" }} className=' btn btn-light fs-6 fw-bold'> Log Out < /button> 
:
<>
<Nav.Link as={Link} to='login' >Login</Nav.Link> 
<Nav.Link as={Link} to='register' >Sign UP</Nav.Link>
</>

return (
  <>
    {content}
  </>
)

Solution 2:[2]

A MySQL FLOAT database column stores (by default) 32-bit single precision floats. These values have limited precision which becomes most obvious for very small or very large numbers. For example, these are the available 32-bit floating point values closest to 1,000,000,000,000: (with their respective difference)

 999999799296.0  # -200,704
 999999864832.0  # -135,168
 999999930368.0  #  -69,632
 999999995904.0  #   -4,096
1000000061440.0  #  +61,440
1000000126976.0  # +126,976
1000000192512.0  # +192,512

If you have a value in-between, it will be converted to the closest float available. Attempting to store the integer 1,000,000,000,000 as a 32-bit float will actually store 999,999,995,904.0 because that's the closest value available, "only" off by 4,096.

The values FLOAT can represent is a subset of the values DOUBLE can represent. Which means that converting a column from FLOAT to DOUBLE is a lossless operation. There's no further precision loss, its numeric value won't change. However, there's no way to reconstruct the original value from the 32-bit float, i.e. converting 999,999,995,904.0 from FLOAT to DOUBLE will still be 999,999,995,904.0.

Storing new values into a DOUBLE column do benefit from the higher precision. That's why you can have 1,000,000,000,000.0 in your DOUBLE column.

Note that floats in Ruby are 64 bit nowadays, i.e. Ruby's Float corresponds to MySQL's DOUBLE.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Martijn Pieters
Solution 2