Robert Moran Posted May 11, 2011 Posted May 11, 2011 I know this is probably a really simple question but...How do I remove a decimal from a number. I am exporting numerical data to an old legacy system and need to remove the decimal point from the number. Any help on this would be great. TIA Bob Moran
comment Posted May 11, 2011 Posted May 11, 2011 It's not quite clear what you mean by "remove the decimal point from the number".
Robert Moran Posted May 11, 2011 Author Posted May 11, 2011 All I want to do is to remove the decimal point prior to doing the export. (it can be a calc field to do the deed) The numbers themselves will retain the decimal point in the DB as they are needed to differntiate products, the legacy system, which is ancient, does not accept numbers with decimals. Don't ask me why, it just does. Best
Rick Whitelaw Posted May 11, 2011 Posted May 11, 2011 All I want to do is to remove the decimal point prior to doing the export. (it can be a calc field to do the deed) The numbers themselves will retain the decimal point in the DB as they are needed to differntiate products, the legacy system, which is ancient, does not accept numbers with decimals. Don't ask me why, it just does. Best It's difficult to imagine a legacy system so ancient as to not accept numbers with decimals. Perhaps the old system has a validation scheme to disallow this. If that's the case I'd disable the validation. I believe it's impossible to remove the decimal point from a value in a Number Field without changing the value of the number. RW
TheTominator Posted May 11, 2011 Posted May 11, 2011 How do I remove a decimal from a number. I am exporting numerical data to an old legacy system and need to remove the decimal point from the number. Any help on this would be great. To convert something like "2.123.450,07" in field MyNumber to "2123450,07" you can do the calculation Substitute(MyNumber; "."; "") If you also have other symbols that can appear in your field value such as a dash or a space, you can remove all of them at once by using Filter() instead. "2.123-450" converts to "2123450" with the following calculation Filter(MyNumber; "0123456789") /* Note that Filter() will require a later version of FileMaker than the version 7 you have in your profile. */ If you have a number like "123.45" MyNumber and want to "remove the decimal from a number" by removing everything to the right of the decimal point and getting "123", you can use Round(MyNumber;0)
comment Posted May 11, 2011 Posted May 11, 2011 All I want to do is to remove the decimal point prior to doing the export. I am afraid that doesn't make sense. If you have a number like "123.45" and you remove the decimal point, you will get "12345". OTOH, "12.345" will also come out as "12345". Once you have done that, there is no system in the world, old or new, that will be able to differentiate between the two. The numbers themselves will retain the decimal point in the DB as they are needed to differntiate products Sounds like these may not be numbers. If you have values like "123.45.678" then the field type should be Text - and you can remove the periods (which are NOT decimal points) simply by substituting them out.
Robert Moran Posted May 12, 2011 Author Posted May 12, 2011 Thanks all for all the info. I really appreciate the input. As a matter of clarification, the altered numbers are just pointers in the legacy system. The DB will maintain what they mean without a problem. Best Bob Moran
Recommended Posts
This topic is 5002 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now