Test Data Manager

  • 1.  TDM Remove decimal

    Posted Jun 14, 2017 09:02 AM

    Hello,

     

    Is there a function in TDM to remove the decimal part of a division.

     

    I don't want to use the round function because it rounds up.

     

    Thanks,

     

    François



  • 2.  Re: TDM Remove decimal

    Posted Jun 15, 2017 01:47 PM

    Hi Francois, 

     

    Can you please provide an example of what you are trying to do and the data that needs a decimal removed?

     

    The Datamaker function ALPHANUM(STRING) removes all non-alphanumeric characters from a string. Would that help?

     

    ALPHANUM(STRING)

    Remove all non-alphanumeric characters from a string.

    Parameters: 

    • STRING — a character string to be cleaned up

    Return value: a new string containing only letters and digits

    Example: @alphanum(12345%%abc)@

    Example result: 12345abc

    https://docops.ca.com/ca-test-data-manager/4-1/en/reference/data-generation-functions-and-parameters 

     

    Best regards,

    Taylor



  • 3.  Re: TDM Remove decimal

    Posted Jun 15, 2017 02:07 PM

    Hello Taylor,

     

    Here is an exemple.

     

    I have a division : 467627 / 26 = 17985.65384615385

     

    I need to remove the decimal from the result = 17985

     

    I can't use round because it will give me 17986

     

    Thanks

     

    Francois



  • 4.  Re: TDM Remove decimal
    Best Answer

    Broadcom Employee
    Posted Jun 20, 2017 11:14 AM

    Hi Francois,

     

    I have checked with Development.  There is nothing that is available to you.  However, as an enhancement, it could be added in the current GA (TDM 4.1).

     

    Cheers!

    Les



  • 5.  Re: TDM Remove decimal

    Posted Jun 23, 2017 03:14 PM

    try this

    @element(~Number~,".",1)@

     

    or 

     

    @round(~Number~,0)@