Zeroes with different digital formats

Hi all

I'm new here, and although I found the basic means to achieve what I'm trying to, I do not get the result I want:

Situation: I have a table that contains a column of 'length' named LAENGE. These fields to store the value of the length in meters. As a result, I want to display the length in kilometers, so I use the following line in my opinion:

-- ...

("Strecke" |) S.STRECKE_NR | "< br > direction | S.RICHTUNG |

"< br > km | S.VON_KM_L |

"bis" | S.BIS_KM_L | '< br > Lange =' | LAENGE/1000 | 'km') as TOOLTIP;

-- ...

In the view that result, values less than 1000 are displayed as ', 123' (e.g., 4321 becomes 4 321, but becomes 123, 123 with zero missing. Usually, I use to_char() for formatting the values, for example to_char (LAENGE, ' 0.999 '). But this only works for values less than 10000, if I use to_char (LAENGE, ' 000,999', it works for all values less than 1000000 which is good, but then I get useless zeros to smaller values.)

Confusing? What I try to achieve is the following:

1234 > 1 234

123 > 0.123

12345 > 12 345

123456 > 123 456

but now, with my to_char (LAENGE, ' 000,999') that I want to say is:

1234 > 001,234

123. > 000,123

12345 > 012,345

123456 > 123 456

I can imagine it's only something simple that I'm missing just here. Any ideas?

Thanks in advance!

See you soon,.

Freddy

Hi, Freddy.

126778f5-5b00-4ab6-9ed8-1279e3c9af46 wrote:

Hi all

I'm new here, and although I found the basic means to achieve what I'm trying to, I do not get the result I want:

Situation: I have a table that contains a column of 'length' named LAENGE. These fields to store the value of the length in meters. As a result, I want to display the length in kilometers, so I use the following line in my opinion:

-- ...

("Strecke" |) S.STRECKE_NR | '
Direction '. S.RICHTUNG |

'
km '. S.VON_KM_L |

"bis" | S.BIS_KM_L | '
Lange =' | LAENGE/1000 | 'km') as TOOLTIP;

-- ...

In the view that result, values less than 1000 are displayed as ', 123' (e.g., 4321 becomes 4 321, but becomes 123, 123 with zero missing. Usually, I use to_char() for formatting the values, for example to_char (LAENGE, ' 0.999 '). But this only works for values less than 10000, if I use to_char (LAENGE, ' 000,999', it works for all values less than 1000000 which is good, but then I get useless zeros to smaller values.)

Confusing? What I try to achieve is the following:

1234--> 1 234

--> 0.123 123

12345--> 12 345

123456--> 123 456

but now, with my to_char (LAENGE, ' 000,999') that I want to say is:

1234--> 001,234

123--> 000,123

12345--> 012,345

123456--> 123 456

I can imagine it's only something simple that I'm missing just here. Any ideas?

Thanks in advance!

See you soon,.

Freddy

What is

To_char (laenge / 1000)

'990D 000'

)

assuming that ',' is the separator of decimal in your environment.

Tags: Database

Similar Questions

  • Work with different raw formats?

    Is the workflow even when working with different raw formats in Adobe Camera RAW? OR did each file requires different steps or processes?

    Thank you.

    Do you mean, for example, NAVE against CR2?

    (Or, to use the vernacular style of the ESPN commentators, NAVE "verse" CR2.)  ;-)

    If so, there is no difference in how you work with them in Camera Raw. The differences are invisible to you, the user.

  • Receive error message when calculating the two fields with different date format

    I'm more familiar with SQL Server and Oracle, then after a search online without success, I ask here.

    I use developer PL/SQL with DB Oracle 11g Release 11.2.0.2.0 Enterprise 64-bit

    MyTable:

    ID_Number VarChar2

    Date of Date_Received

    Select ID_Number,

    Date_Received,

    To_Date (substr (ID_Number, 1.6), "YYMMDD") SentDate,.

    Date_Received - NumDays To_Date (substr (ID_Number, 1.6), "YYMMDD")

    FROM MyTable

    Where substr (ID_Number, 7.3) in ('ABC', 'ABD')

    and length (Trim (translate ((substr (ID_Number, 1,6)), '0123456789',' '))) a null value

    ID_Number Date_Received SentDate NumDays

    131002ABC1654106 10/16/10/2013-2013 14 2

    131004ABD8813899 4/12/2013-4/8/2013 4

    131014ABD1844832 10/16/10/14 OF 2013-2013 2

    Sometimes the first 6 characters in the ID_Number aren't the numbers and length (Trim (translate deletes records))

    I want just the records where NumDays > 2

    I tried to put the request in a subquery and using where NumDays > 2 outside.  I also tried using the calculation directly in the Where clause.  Without it in Where clause it works very well, with him in a place, I get the following error:

    ORA-01931: Date format picture ends before converting all of the input string


    I don't know how to put the two dates in the same format.  I tried to declare the format without result.  I don't understand how I can calculate in the selection, but do not use the same calculation in Where clause.

    Thank you for your help.

    Hello

    SQL is a language to describe the desired results.  How the system gets these results belongs to you don't have much say about which conditions will be applied when.

    One place where you can control the order of things is a CASE expression.  When you say

    CASE

    WHEN condition_1

    THEN expression_1

    END

    You can be sure that expression_1 will be evaluated only when cond_1 is set to TRUE.

    Try something like this:

    WITH got_sent_date AS

    (

    SELECT id_number, date_received

    CASE

    WHEN the TRANSLATION (SUBSTR (id_number, 1, 6)

    , 'x' 0123456789 '.

    , 'x'

    ) IS NULL

    THEN TO_DATE (SUBSTR (id_number, 1-6)

    , "YYMMDD".

    )

    END AS sent_date

    FROM MyTable

    WHERE (id_number, 7, 3) SUBSTR ("ABC", "ABD")

    )

    SELECT id_number

    date_received

    sent_date

    , date_received - sent_date AS num_days

    OF got_sent_date

    WHERE date_received > sent_date + 2

    ;

    If you would care to post some sample data (CREATE TABLE and INSERT statements) and the results desired from this data, I was able to test this.

    Of course, you'll still errors of execution if id_number starts with 6 digits, but they do not have to be valid, for example '131100' or '130229'.  This is one of the reasons why the date information storage in VARCHAR2 columns are a bad idea.  To work around this problem, see

    https://forums.Oracle.com/message/4255051

  • regexp: how to deal with different date formats?

    the date comes as varchar2 with '-'and':' as separators for day part and part time respectively. but it may come with different formats such as

    1993-05-17
    1993-05-17 13:04:23
    1993-05-17 13:04
    1993-05-17 13:4
    1993-05-17 13:04
    1993-05-17 13:4:2
    1993-5-17-13:4:2
    1993-5-7-13:4:2

    and so on. date of final format should be ' YYYY-MM-DD HH24-SS'. is it possible to have an intelligent way to deal with different formats of date with separators above and convert the final using regexp format, so that it is compact and universal as possible with assumptions/examples above?

    Thank you

    As others have said, the smartest way is to keep your input in a format method and store your data in a date column.
    But is a simple way to deal with this mess, without regexp,

    with test as (
    select '1993-05-17' d from dual
    union all select '1993-05-17 13:04:23' from dual
    union all select '1993-05-17 13:04' from dual
    union all select '1993-05-17 13:4' from dual
    union all select '1993-05-17 13:4:2' from dual
    union all select '1993-5-17 13:4:2' from dual
    union all select '1993-5-7 13:4:2' from dual
    union all select '1993-05-17 1:4 PM' from dual
    )
    select d
         , to_date( translate( d, 'xampAMP', 'x' )
                  , 'yyyy-mm-dd hh24:mi:ss'
                  )
         + case when instr( upper( d ), 'P' ) > 0 then 0.5 else 0 end cd
    from test
    
  • Build &amp; write to text with different column formatting

    3 days, I just pass on what appears to be a simple problem:

    I have a VI that reads a significant length TDMS file containing data sampled at 1 MHz 2-channel (very large files of course). The VI only runs 1 second at a time and looking for threshold crossing points and calculates the energy at this time there. In any case, I'm writing a text file where a column contains the number of the sample and the second column contains energy, annexed whenever the VI iterates (the number of rows generated by iteration may vary). It's simple by using the function 'Write to Spreasheet', the problem is I want a different format on each column. The sample number must be set to zero decimal and energy must be set on, say, 3 significant digits.

    A typical few lines should look like (delimited by tab characters, commas are there to represent the tabs):

    Time (samples), energy

    267935, 0.0000346

    545227, 0.000298

    1298655, 0.0000000122

    1314522, 0.00854

    'Write to Spreasheet' allows only a single format, so I have either a large number of DPs on my number of sample or energy value is 0.

    If I use 'Table in chain worksheet', I can set the formatting, but I can't seem to be concatenated, to build or to transpose the outputs in the right direction, no matter what I try.

    In the attached image I use Ch1 as my experience; CH2 using the traditional but unsatisfactory method "to write to the spreadsheet. The current VI returns on Ch1:

    Time (samples), energy

    267935

    545227

    0.0000346

    0.000298

    1298655

    1314522

    0.0000000122

    0.00854

    I hope that the image of the relevant part of the VI just go. I can reach the VI if necessary, but it seems unnecessary that I won't be able to share the data files for the tests.

    You can use the 'number of fractional string' primitive to convert data DBL to the chain with the required precesion. Then when you use this string 2D array and write in the file using 'write to the worksheet VI' it should work fine.

    If you still face any question please include the code with the data in a constant and registered in the 2012 version.

  • Problems of transparency with different file formats? Photo included

    I designed a logo in illustrator. Part of the logo is a vector image, I created. I am recording this vector image in eps or tiff, must be placed in an inDesign document. However, whenever I try this, a weird white box appears behind her. I double everything in the illustrator file checked and there is no separate white object or an involuntary white fill any where. It is perfectly clean. When you save in jpg or png, it seems, it's just with the eps or tif.

    This is what it looks like:

    Screen shot 2011-06-10 at 5.11.53 PM.png

    This is a screenshot of a PDF (made through indesign using an eps). I have it? haha. I used a black background make it just easier to see the white box. Basically, it keeps happening everytime I use an eps or tiff image. Why is this happening? I tried to set the transparency to high resolution when the eps as well. The only thing I can think of is maybe a problem with the shadow of the Crescent? I know illustrator can be weird with gradients and shadows.

    I have to resort using a different file type, but I would have preferred to use eps or tiff, as this is part of an identity system used in various sizes.

    If anyone has any ideas, I would be very happy!

    Simply place the file IN InDesign.

    An EPS may not contain transparency and always have white box.

  • 1 model of multiple MOV files with different rendering formats?

    Hey guys, I just find the "Add Output Module", which can make my computer more than a MOV file, which is great.

    I just want to check, that's for sure, or it is put to the test the system? Thank you!

    I usually make a file in After Effects and then use a workflow similar to what you describe in Adobe Media Encoder to make my deliverables.

    After effects can not make multipass encoding, if you H. 264, as Rick says, you will really have a less-buggy more multipass-capable encoder such as Adobe Media Encoder.

  • Save pictures png with different names...

    Hello guys,.

    I'm not so familiar with Labview and I want help. I have a Vi which is actually control 32 RBG lights. We use the DMX Protocol... to each time a directed is on and then we take a picture, then the led goes out. The second goes on then end and on... We have 8leds in 4corners... So, we corner1_led1, corner1_led2 up to corner4_led8. Ultimately, we are 32 saves png pictures. What I want is to record photos with different names and numbers starting from 1 instead of 0... For example, if we choose the white light and save the images in 'News' images will be named 'new_white_0_0' instead of 'new_white_1_1 '. You have an idea how I can change it?

    Attached the names of current photos and Vi.

    Any comments would be useful.

    Thank you.

    The terminal of indexing ([i] in the loop for) starts at 0. When you create your file name, use the primitive "to increment" digital palette. Then your file names will start at 1 instead of 0.

    I noticed your VI that you do a lot of string concatenation to build the path/name of the file, you can use the format string and build the screw to make the somewhat simpler schema. You can also update the deprecated functions (for example, the file open) with modern equivalents.

  • How can I get date uniform and exit time to get-stat on servers located in areas with different regional settings?

    Hello together,

    I use a HSP on different vCenters script all over the world to sample performance data. Unfortunetaly vCenter servers concerninbg time Windows locale and date are different. For this reason that I ve had different and output date at the time of the csv. Here is an example to read a virtual computer processor performance.

    Get-Stat - feature $vm.name - Stat "cpu.usage.average" - IntervalMins 5 - (Get-Date).adddays(-1)-.addminutes(-5)-MaxSamples Start to finish (Get-Date) 288. Select-Object timestamp, value, unit | Export-Csv

    vCenter Server located in the United States with the American Time (12-hour AM/PM) and the settings of Date (day/month/year):

    'Timestamp', 'Value', 'unit '.

    "2010-06-27 12:00 PM","2.75","%.

    "

    "

    vCenter Server located in Europe with countries European regionalen (24 hours) and Date settings (day.month.year):

    Timestamp, value, unit

    "21.06.2010 20:00:00", "3.06", %

    "

    "

    For the import of these data to our central database, the formats must be uniform.

    Someone at - it an idea to get the uniform format?

    Thanks in advance

    Concerning

    Oliver

    Why don't you use the solution in Use-Culture - Culture culture - Script {scriptblock} ?

    You do all the writing to your database in 1 selected (for example en-US culture).

    This way all your date and and digital formats have the same layout.

    ____________

    Blog: LucD notes

    Twitter: lucd22

  • No sound with Dolby Digital and MPEG-2 4:2:2?

    Hello

    I tried several times to encode a video file in MPEG-2 using the Media Encoder CS6 with Dolby Digital Stereo audio and with the 4:2:2 profile in the video tab. However, the generated file has no audio on it and reads with just video. Once the 4:2:2 file has been converted to a different format, audio feedback, so I know that there is audio in this file, just for some reason, it won't play back.

    I use Mac OS X v10.7.3 with Media Encoder 6.0.1.31 (CS6), running on 8 GB of RAM, Intel Dual-Core i3, 3.06 GHz.

    Also, until someone asks questions about codecs, I was able to read AC3 on my machine, so this isn't the issue. Is it maybe a bug?

    -Christmas

    Thanks Noel for close inspection.

    Well Yes, the audio is there, but some players may not play.  It seems that the CS6 SOUL that prepares the different audio connector for MPEG2 multiplexed Dolby as SOUL CS5.5 on which there was no question on the same format.  This question was tabled in our bugs and system under investigation for the reason of this change and the solution.

  • I get no picture on the TV when using mini ipad with the Digital AV adapter.

    I get a white on my TV screen when I connect my mini ipad digital AV adapter except HDMI 1 showing in the upper left corner of the TV screen. My mini2 ipad works great with the same son and TV.  I tried two ipads with different TV but get the same result. The ipad mini works OK if not connected to the TV. Two minis are working on the same operating system setting.

    The Digital AV adapter can be finnicky.

    Have you tried simply unplug and plug the adapter with the HDMI cable connected with it?

    With the adapter always plugged into your iPad, have you tried a hard reset of your iPad by pressing the sleep/wake and Home buttons simultaneously until your iPad goes to the dark and restarts with the Apple logo, then release them buttons?

    Good luck!

  • How to structure the DMA buffer for SMU 6341 DAQ card for analog output with different frequencies on each channel

    I use the outgoing/incoming analog DDK with the DAQ 6341 SMU map.

    The examples, for example aoex5, show a single timer (method outTimerHelper::loadUI), but the example shows the DMA loaded with same size of vector data.

    There is a comment in the outTimerHelper:call rogramUpdateCount, which implies that memory sizes different pad per channel can be used.

    (the comment is: switching between the sizes of the various buffers is not used)

    Nobody knows what should be the format the DMA buffer for data from multiple channels with different frequencies?

    For example, we want a0 with a sinusoid at 1 kHz and a1 with a sine wave of 1.5 Khz.  What looks like the DMA buffer?

    With the same frequency for each channel, the data are interleaved, for example (ao0 #0, ao1 #0; ao0 ao1 #1, #1,...), but when the frequencies for each channel is different, what the stamp looks like?

    Hello Kenstern,

    Data are always intertwined since each card has only a single timing for each subsystem engine.

    To AO, you must specify the number of samples that will be released to the AO. You also specify the number of channels. Because he didn't is that a single engine timing for AO, each AO will be channel will be updated at the same time to update clock tick. Data will be interlaced exactly as shown in the example because each channel AO needs output at each tick of the clock to update. The data itself can change depending on the frequency you want to copy.

    kenstern wrote:

    For example, we want a0 with a sinusoid at 1 kHz and a1 with a sine wave of 1.5 Khz.  What looks like the DMA buffer?

    With the same frequency for each channel, the data are interleaved, for example (ao0 #0, ao1 #0; ao0 ao1 #1, #1,...), but when the frequencies for each channel is different, what the stamp looks like?

    In your example, you must come with an update rate that works for the two waveforms (sine waves of 1 and 1.5 KHz). To get a good representation of a sine wave, you need to update more than 10 x faster than your fastest frequency... I would recommend x 100 if possible.

    Update frequency: 150 KHz

    Channels: 2

    Then create you stamps that include complete cycles of each wave you want to produce based on the frequency of update. These buffers must also be of the same size.

    Buffer 1: Contains data for the sine wave of 1 KHz, 300 points 2 cycles of sine wave

    Buffer 2: Contains data for the sine wave of 1.5 KHz, 300 points, 3 cycles of sine wave

    You can Interleave them as before. When the data are performed through the ADC, they are out different sine waves, even if the AO channels are updated at the same speed.

  • Workspace: unregistered control/indicator Digital Format

    Hello

    Using VS 2013, I'm not able to maintain the digital format of a digital medium.

    • Open and run the project delay example of Sinewave

    • On the workspace, do a right-click on a digital indicator to open the dialog box change point

    • Go to the tab Format & accuracy, Format has a value other than Decimal (engineering here) click OK.

    • Save (File' Save) and leave the workspace

    • Run the project again

    • On the workspace, do a right-click on a digital indicator to open the dialog box change point

    • Go to the tab Format & accuracy: Format value is decimal (and not the previously defined value)

    I do not think it is the expected (also tested with VS2012) behavior. This applies also to controls.

    I did something wrong? Is this a bug? Am I the only one having this problem?

    Best regards

    Matheiu Hey,.

    It is certainly a bug. It shouldn't work like this.

    We have the question followed internally as CAR #449833. Keep an eye on this number in the section of the fixed a Bug of version of the fix to come/releases readme (similar to this). We should hopefully get it sent soon!

  • fractions of a second with set digital?

    Im trying to use Get Date/Time in the Seconds.vi with String.vi of Format Date/time to get the precision fratcional seconds. According the context help Im trying to use the %u, but it won't work, I use %Y and get the year or same %S to get seconds regular but not fractions of a second?

    See you soon,.

    Sam

    Sam,

    You can create an indicator of production of seconds in time in right at the exit of the terminal and select "create > indicator. Run the VI once to update the indicator.

    The indicator will have different "sections" with different information. The first would be "fractions of a second. You can extract this component using the primitive Unbundle name found in the palette of cluster.

    hope this helps,

    Norbert

    PS: Maybe you should spend some time to accomplish this tutorials.

  • Several channels with different frequencies

    Hello

    I use card NI USB-6221.

    The C API using, I need to generate 6 digital output channels, with frequencies of diffrenet and Heavy duty.

    To be more precise, the 2 are totally identical, but I need them to be reversed, and the other 4 are similar to another, but should be shifted in time (I.e. There is a delay between each of the channels).

    I used the 2 channels of CO that the USB-6221 takes charge for the first two signals, and it works very well (the two signals are synchronized and are reversed).

    Now I need an additional 4 channels for the other vague square.

    I saw an articale NOR by JohnP web site with the title:

    Generate multiple channels of digital output with different frequencies and Heavy Duty

    The following example shows how to create and generate a digital with the non-regeneration wave form so that you can change the frequency and the duty cycle on the fly with the M Series DAQ hardware X.  The example uses output digital rather than counters to achieve this, so if you need more output than the available counters, it would be a good option (Note: on the materials of the M series an external sample clock must be provided, this may be caused by one of the counters if you want).

    that seems to be exactly what I need, but the examples are for LabView which I did not.

    Can someone explain how to do this with the C functions?

    Best regards

    Danny.

    Hey Danny,

    The important thing to note is that you can clock of arbitrary digital waveform (up to 1 MHz on the 6221).  The real data acquisition programming is pretty easy once you have the waveform.  My Example LV used LabVIEW Base generating function VIand then converted to a digital waveform to generate the signal from each channel.

    The functions of LV helped tremendously with to achieve the waveforms to be updated on the fly (the basic function generator keeps track of phase for you).

    If you do not need to be updated on the fly, then the construction of the waveform in C should not be too bad.  For example:

    P0.0 [1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0] * 1

    P0.1 [0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0] * 2

    P0.2 [0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1] * 4

    P0.3 [1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1] * 8

    [9 9 9 9 9 3 3 3 3 3 6 6 6 6 6 12 12 12 12 12]

    The table above U8 would give you 4 output waveform of 50% duty cycle at Fs/20, shifted 90 degrees to eachother.  The lines would be p0.0 by p0.3 (the bit rate of the U8 corresponds to what line goes high).

    Best regards

Maybe you are looking for

  • Call is disconnected frequently Iphone6 with ios 9.3.1

    It seems after I updated my iOS to 9,31. All my calls (incoming /Outing) getting abruptly disconnected in seconds. Indeed one day it happened more than 20 times. I'm missing something in my settings. Appreciate your valuable suggestions. Kind regards

  • HP Pavilion - 15-ab045sa: a few gestures of precision Touchpad not working not

    Hello I'm new to the forum, so I hope I posted in the right place. My product: HP Pavilion Notebook - 15-ab045sa (ENERGY STAR) I have all the gestures of touchpad usual work (three stroke of finger etc).  However, the recent to THE introduced a new g

  • brother printers are compatible with the HP laptop

    My brother MFC-7420 printer is compatible with my new HP laptop? The software is not installed. In fact, any other software, I tried to download from a CD will not be installed. Y at - it secret inatalling software on HP laptop? It was so easy on my

  • Z420: How to recover Z420 OS like new without recovery partition

    Hi all I have a workstation Z420 and I me remember a win8.1 of what OS has been installed yet on this subject when I just buy. Then I installed Ubuntu above and choose "erase the entire disk for ubuntu iinstalling. Now, I want to retrieve the origina

  • Question to look at a picture T4i

    T4i when I try to view pictures in the screen of the image, I get a small version of the image, but camera says "cannot display the picture. I formatted the card and when I take the photo, it appears. That's when I scroll through the photos he sudden