Forum Discussion

eduardovaldes's avatar
eduardovaldes
Qrew Member
8 months ago

Number formatting in pipelines.

Number formatting in pipelines.

 

I am trying to pass some number values in a pipeline.

Simple from one table to another

 

My number formats are 123.456,78. I don't use 123456.78 or 123,456.78

 

Pipelines only work if the original number format field and the destiny field both are formatted with 123456.78.

 

Other setting multiplies de number by 10.

 

Have tried to look up the record before copying the value.

 

Only works with a run import API call, but I have to complicate the pipeline to use run imports….

Use a shadow table, transform the data and do an api call, merging the tables.

 

Is there a jinja transformation needed that can solve the problem?

 



------------------------------
eduardo valdes
------------------------------

3 Replies

  • This is Straight cut and paste from chatGPT , maybe useful to you , since I have never across this number format (I am from India)

    --- 

    Yes, in Quickbase with Jinja templating, you can manipulate the format of numbers to suit your needs.

    Given the number format you've mentioned (123.456,78), it seems you're using a European-style number format where the period is used as the thousands separator and the comma is used as the decimal separator.

    If you want to convert this format (123.456,78) to a more standard format (123456.78), you can use Jinja's string manipulation capabilities.

    Here's a step-by-step breakdown:

    1. Replace the period (.) with nothing, effectively removing it.
    2. Replace the comma (,) with a period (.).

    Here's how you can achieve this using Jinja:

    {% set number_str = '123.456,78' %}
    {% set standard_format = number_str.replace('.', '').replace(',', '.') %}
    {{ standard_format }}

    This will give you `123456.78`.

    Now, if you have this number in a field in Quickbase, you'll have to reference that field in your Jinja template, and then apply the above transformations.

    Remember, this approach assumes that your number is always formatted with a period as the thousands separator and a comma as the decimal separator



    ------------------------------
    Prashant Maheshwari
    ------------------------------
    • eduardovaldes's avatar
      eduardovaldes
      Qrew Member

      Thanks Prashant for your answer.

       

      Think I didn't explain myself.

       

      My format numbers are European (actually Brazilian that further complicates UTF-8 issues)

       

      A.- In a pipeline I read one number.

       

      B.- In another step I copy that number to another table that is also European formatted

       

      The number gets multiplied by 10.

      Seem that in the middle the number is converted to 1234546.78, and in the import process the 2 numbers are in different formats.

       

      I thought maybe I could force with a jinja expression to keep the format 123.456,78 (European)

       

      I am going to try performing a Bulk upsert to see if that works.

      When I perform an api call (run import) numbers keep their formats.

      I remember I had a similar problem with exact forms+  which I solved transforming the number to text format.



      ------------------------------
      eduardo valdes
      ------------------------------
      • PrashantMaheshw's avatar
        PrashantMaheshw
        Qrew Captain

        Thanks for the explanation. You can similarly force the number to text in Jinja as well with a string filter 

        Pipeline is pretty stiff currently when it comes to interpreting few things , for example all duration fields are stored in milliseconds, it could be doing something similar to you number fields by stripping comma , but I am not clear with this. 

        Maybe you can also see how pipeline is reading by checking the logs , that's how I discovered the milliseconds . 



        ------------------------------
        Prashant Maheshwari
        ------------------------------