Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

Colon removal function


Question

Posted (edited)

 

There is data in the scene that uses a colon (18:36). The number is taken from the variable.

What function can I use to remove the colon in the scene?

Required (1836)

Edited by Flash226

4 answers to this question

Recommended Posts

  • 0
Posted

Please login or register to see this code.

Please login or register to see this spoiler.

 

  • Thanks 2
  • 0
  • Inquirer
  • Posted (edited)

    Please login or register to see this code.

    works, but 

    Please login or register to see this code.

    i have a error. 

    The number is saved to the global variable in this form 

    Please login or register to see this code.

     

    Please login or register to see this image.

    /monthly_2018_10/1935482761_ScreenshotatOct2114-55-46.png.267c26128eea443c9edc3da48463a120.png" />

     

     

    Please login or register to see this spoiler.

     

    Edited by Flash226
    • 0
    Posted

    Try this...

     

    name = '18:36'

    fibaro:debug('Name: ' ..name)

    name = string.gsub (name, ':', '')

    fibaro:debug('Name (edited): ' ..name)

    • Thanks 1
    • 0
    Posted
    On 10/21/2018 at 3:01 PM, Flash226 said:

    The number is saved to the global variable in this form 

    Please login or register to see this code.

    Sorry, but it cannot be saved at this format. You fail.

    LUA can save vars in string “” , numeric 123 or 123.8877 etc also LUA has tables 

    but 19:01 it’s not valid type.

    can you show me all your requirements or write me to PM

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...