Results 1 to 3 of 3

Thread: [Answers] Numeric

  1. #1
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135

    [Answers] Numeric

    Q: How do I display the actual number without having it being rounded? a numeric database value being displayed in a canvas textbox.
    If the value saved is 523.65, the displayed value is 524.
    A:
    ALLTRIM(STR(TOTALDUE,10,2))



    Q:
    My form section has calculated fields whose values are computed based on records in other tables
    May I know where should I put code to perform the actual calculation and to refresh the calculated values when records in those tables are changed?
    A:
    Any field in a form section that has an expression as its data source is automatically a calculated field. It will be calculated and displayed any time you navigate data.
    Look at the section and field attributes and you will find attributes that tell Lianja to recalc and redisplay calculated fields automatically as you perform data entry.
    Also, grids can have calculated columns as well as horizontal and vertical totaling and subtotaling with conditional color coding of the grid cells.
    Q:
    My calculation in this case is complex
    Can the expression call a server procedure in server too using Lianja.Evaluate()?
    A:
    Yes. The data source can be a function call which is executed on the server. Just remember that in a web / mobile app, this is a client / server architecture so the server knows nothing about the context of what you are doing on the client. You should therefore substitute data context as parameters to the remote function call using {...} macros or else call a client side javascript function that builds the parameters up and the uses Lianja.evaluate() to make the remote function call.

    Added a new field (form and canvas sections) attribute "Recalculate". When data is entered into a field interactively any readonly or calculated fields are automatically recalculated and re-displayed. This is typically used to calculate totals e.g. if you have three columns; Quantity,Price,Cost and "Cost" is calculated by quantity*price, then as you change either quantity or price the "Cost" field will be recalculated and refreshed.



    ​All topics in [Answers] alphabetically:http://www.lianja.com/community/show...ll=1#post12352

  2. #2
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135
    Q:
    What is the best way to get a numeric value out of an input box
    A:
    Use parseInt()
    Code:
    var mynum = parseInt(Lianja.evaluate("inputbox('Please enter number','Number','')")); 
    or
    Code:
    var mynum = parseInt(prompt('Please enter number','','Number'));


    All topics in [Answers] alphabetically: http://www.lianja.com/community/show...p?2717-Answers

  3. #3
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135
    Q:
    I added a Textbox and a Numeric textbox to a canvas.
    When I looked at the vartype of the value, they both show "C".
    I expected the Numeric textbox to be "N".

    A:
    The Numeric textbox accepts digits and is formatted to right-align, but still contains text and has a character 'value'. A spinner can be used to hold numeric values.



    Q:
    If I click and drag a numeric table field into a section, a numerictextbox will be auto created. However, the alignment is left. Changing the text alignment attributes does not seems to have an effect, so is there anyway to change to right align?


    A:
    In the web client the digits are left aligned, but in the desktop client, setting 'Text alignment' to right (or center) should control the data text alignment.
    effect only applies to desktop.




    All topics in [Answers] alphabetically: http://www.lianja.com/community/show...ll=1#post12352

    These answers are also systematized on the site "Lianja developer": https://lianjadeveloper.wordpress.com/category/numeric/

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us