Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Remove decimals from String

  1. #1
    Join Date
    Sep 2011
    Posts
    9

    Default Remove decimals from String

    I have a field that use to be a number field and after I converted it to a string field the values kept the decimals. I want to remove the decimal point and all of the decimals. See below for examples of what I have now and what I want the result to be.

    EX. Go from 0054865821.0 to 0054865821
    EX. Go from 0000548759.0 to 0000548759

  2. #2
    Join Date
    Mar 2006
    Posts
    170

    Default

    Hi Jallen,

    In a Trans use the "Replace in string" step ... put a '.0' in the search field and nothing in the replace with field.

    Thx

    Kent
    Last edited by kandrews; 10-27-2011 at 05:09 PM. Reason: s/b .01

  3. #3
    Join Date
    Sep 2011
    Posts
    190

    Default

    Quote Originally Posted by jallen View Post
    ... after I converted it to a string field ...
    Can you convert it to a string field with a mask/format? Then you can convert it without the decimal in the first place...

  4. #4
    Join Date
    Sep 2011
    Posts
    9

    Default

    I tried both kandrews' and mbvt's methods and they both worked! I'm going with mbvt method in the future for what I need to do, but both seemed to work just fine. Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.