- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How correct convert from Decimal with E to float in Apache NiFi ?
- Labels:
-
Apache NiFi
Created ‎11-21-2018 05:32 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I suppose that my problem is very simple.
I have a problem with correct convert from Decimal to float in NiFi. I have an attribute originalTime with value
2.0160408003959164E13
When i use UpdateAttributeProcessor and then I write ${original:toNumber()}
I get value like this:
20160408003959
I know that correct format is:
20160408003959.166
How is method of correct conversion and how properly get .166?
Created ‎11-23-2018 12:37 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok. I found a simple solution to convert Scientific Notation To Decimal Notation.
I used ExecuteScript processor and i writed a simple script in JavaScript .
The code is below:
var flowFile = session.get(); if (flowFile != null) { var date = flowFile.getAttribute('date'); var valueDate= Number(date); flowFile = session.putAttribute(flowFile, 'date', valueDate); } session.transfer(flowFile, REL_SUCCESS)
