• Resolved Sara

    (@mightysparkdesign)


    Hi there,

    I’m loving your plugin but have come across two issues I can’t seem to resolve.

    The first is a currency issue: in the first 3 rows, the user can increase the number and the calculated US dollar amount displays in the right column. But in some instances, when a certain number is selected, there are many numbers displaying after the decimal instead of just 2. For example, in the first row if you increase the number to 3, the calculation should be 30.15 but the number that displays is 30.150000000000002. I do have the Currency checkbox selected in the Calculated Field settings.

    The second issue is displaying the columns. In the link I provided, the first 3 rows are evenly spaced using *col-4 and those are fine. The second/last 3 rows are set to be displayed in 2 columns, with the left set at *col-9 and the right at *col-3, as I’d like the right column to display evenly with the columns above. But I can’t seem to changes the extra spacing on the right in those 3 columns. I’ve tried adding a DIV field to clear as you mention in your FAQ but that doesn’t fix it. I’ve also tried changing the column numbers (ie *col-10, *col-2) but nothing changes there, either.

    Any assistance you can provide on these 2 items is greatly appreciated.

    • This topic was modified 1 year, 8 months ago by Sara.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @mightysparkdesign

    The issue with decimal places is not specific to the plugin. It is an accuracy issue with the Javascript engine implemented by browsers in mathematical operations with decimals. Please, look at the screenshot image below. I evaluated the operation directly in the browser’s console:

    To prevent the issue in the javascript engine affects the result of the calculated field, you should use the PREC operation as the outermost operation in the equation:

    PREC(X, Y) rounds the number X with Y decimals.

    For example, if you have the equation fieldname1*fieldname2, and you want to get the results with two decimal places, you should edit it as follows:

    PREC(fieldname1*fieldname2, 2)

    Concerning the fields’ distribution, in the last three rows, please, assign the class name col-xs-4 to the fields fieldname30, fieldname31, fieldname33, fieldname35, fieldname37, and fieldname38.

    Best regards.

    Thread Starter Sara

    (@mightysparkdesign)

    Hey @codepeople thanks for the super fast response! I have the decimal issue fixed – works perfectly. Still no change regarding the column spacing in those last 3 rows, so not sure if there’s something else I’m missing or going on. Thanks!

    Plugin Author codepeople

    (@codepeople)

    Hello @mightysparkdesign

    The issue with the fields’ distribution is simple. You are using two models of columns at once, creating a conflict.

    You have the fields into containers (DIV fields) with the option “2 Columns” selected through their settings. Please, select the one-column option in their DIV fields. Also, you have assigned col-xs-9 col-sm-9 col-lg-9 to the fields, use only col-xs-4

    Please, watch the video by visiting the following link:

    https://resources.developers4web.com/cff/tmp/2023/07/06/video_o.mp4

    Best regards.

    Thread Starter Sara

    (@mightysparkdesign)

    Awesome, makes sense now – thanks for your help!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘2 issues: currency and column formatting’ is closed to new replies.