title: Kotlin check if a variable is between two numbers
body: <p><strong>I have a current time from LocalTime.now(). I want to use this current time in check if between two double number But I can't convert the time to double</strong></p>
  <pre><code>override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
      super.onViewCreated(view, savedInstanceState)
  
      val CurrentTime = LocalTime.now().format(DateTimeFormatter.ofPattern(&quot;HH.mm&quot;))
  
      tvDetailIcon = view.findViewById(R.id.tvDetailIcon)
      testTime = view.findViewById(R.id.testTime)
      testTime.text = CurrentTime
  
  
      if (24.00&lt;testTime &amp;&amp; testTime&lt;25.00 ){
          constraint.setBackgroundColor(Color.parseColor(&quot;#34495e&quot;))
          tvDetailIcon.setImageResource(R.drawable.ic_baseline_nights_stay_24)
      }
  
      else if (1.00&lt;testTime &amp;&amp; testTime&lt;24.00){
          constraint.setBackgroundColor(Color.parseColor(&quot;#349Bdb&quot;))
          tvDetailIcon.setImageResource(R.drawable.ic_baseline_wb_sunny_72)
  
      }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/0mBkJ.png" rel="nofollow noreferrer">You can find fail here.</a></p>