Graphics

 View Only
  • 1.  Rounding Decimals with script or visual Logic

    Posted 05-14-2024 12:25

    Howdy folks!

    I have a project that is reading information from a datalinq source. That data is a string of numbers in a decimal format,  example 59.888721....

    I want to display this information without the decimal, either by rounding or truncating the decimal. Any ideas on how to do this either with scripting or visual logic?



    ------------------------------
    Lee Mann
    On Air Director
    WAKA 8
    ------------------------------


  • 2.  RE: Rounding Decimals with script or visual Logic

    Posted 05-14-2024 12:34

    VisualLogic

    Math functions -> Round



    ------------------------------
    Azathoth
    Son of Cthulhu
    ------------------------------



  • 3.  RE: Rounding Decimals with script or visual Logic

    Posted 05-14-2024 12:45

    Thanks for the help!



    ------------------------------
    Lee Mann
    On Air Director
    WAKA 8
    ------------------------------



  • 4.  RE: Rounding Decimals with script or visual Logic

    Posted 05-14-2024 13:26

    OnSetText

    text  = FormatNumber(text,0)   the zero is the number of decimal places



    ------------------------------
    Simon Redmile
    Senior Graphic Programmer & Designer
    Ross Video
    Bristol United Kingdom
    ------------------------------



  • 5.  RE: Rounding Decimals with script or visual Logic

    Posted 05-14-2024 13:26

    OnSetText

    text  = FormatNumber(text,0)   the zero is the number of decimal place 



    ------------------------------
    Simon Redmile
    Senior Graphic Programmer & Designer
    Ross Video
    Bristol United Kingdom
    ------------------------------



  • 6.  RE: Rounding Decimals with script or visual Logic

    Posted 30 days ago

    Just to add additional options, you can use the "Format Float" block in Visual Logic (under the Strings category) to take a decimal number and select how many digits of precision you'd like, or even set a custom format such as to convert into a currency.



    ------------------------------
    Zachary Fradette
    United States
    ------------------------------