title: Tkinter entry widget validation
body: <p>New to GUI's in Python and using Tkinter. Trying to get a format check validation to work in an entry box (want to allow float's only). Returns this error <code>tkinter.TclError: expected floating-point number but got &quot;0.0fhdhdfhdf&quot;</code> and tkinter message box does not display.</p>
  <p>I declared the variables earlier in the code as <code>DoubleVar</code>. I know it's a data type issue but have tried everything. Any ideas appreciated?</p>
  <pre><code>#3 x variables declared 
  value0 = StringVar()
  convert = DoubleVar()
  currency = DoubleVar()
  
  #This is the boolean currency converter defining the ConCurency method which calls the variable value0 and speeding up conversion of the float using parallel program with the get and set class for the value of USD/JPY/EUR
  max_input = 50000
  min_input = 10
  
  def ConCurrency(): #performing the conversion #credit to https://www.youtube.com/channel/UCI0vQvr9aFn27yR6Ej6n5UA This was a you tube video, that I found and have changed to suit my needs.  
   if value0.get() == &quot;USD&quot;:
       convert1 = float(convert.get() *1.34)
       convert2 = &quot;USD&quot;, str('%.2f' %(convert1))
       currency.set(convert2)
   elif value0.get() == &quot;JPY&quot;:
       convert1 = float(convert.get() *146.4131)
       convert2 = &quot;JPY&quot;, str('%.2f' %(convert1))
       currency.set(convert2)
   elif value0.get() == &quot;EUR&quot;:
       convert1 = float(convert.get() *1.1300)
       convert2 = &quot;EUR&quot;, str('%.2f' %(convert1))
       currency.set(convert2)
   
  # defining the Reset value for the original value0 using the set class.
  def Reset():
     value0.set(&quot;&quot;)
     convert.set(&quot;0.0&quot;)
     currency.set(&quot;0.0&quot;)
     
  #Entry Widget - to create the input space for the user to add their amount of GBP.  
  ent_Currency=Entry(MainFrame,font=('PlayFairDisplay'), textvariable=convert, bd=2,width=28, justify='center')
  ent_Currency.grid(row=0,column=1)
  
  def validate(convert):
          if convert.isdigit:
              return True
              tkinter.messagebox.showinfo(&quot;Correct Data&quot;,&quot;That is a valid input&quot;)
          else:
              False
              currency.set(&quot;&quot;)
              tkinter.messagebox.showwarning(&quot;Wrong Data&quot;, &quot;Numbers Only&quot;)
                          
  
      
  </code></pre>