Click here to Skip to main content
15,892,005 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Difficult to sort : SOLVED!! Pin
Kenneth Haugland12-Feb-15 4:51
mvaKenneth Haugland12-Feb-15 4:51 
GeneralRe: Difficult to sort : SOLVED!! Pin
Amarnath S12-Feb-15 2:30
professionalAmarnath S12-Feb-15 2:30 
GeneralRe: Difficult to sort : SOLVED!! Pin
PhilLenoir12-Feb-15 2:50
professionalPhilLenoir12-Feb-15 2:50 
GeneralRe: Difficult to sort : SOLVED!! Pin
newton.saber12-Feb-15 2:54
newton.saber12-Feb-15 2:54 
GeneralRe: Difficult to sort : SOLVED!! Pin
PhilLenoir12-Feb-15 2:58
professionalPhilLenoir12-Feb-15 2:58 
GeneralRe: Difficult to sort : SOLVED!! Pin
newton.saber12-Feb-15 3:14
newton.saber12-Feb-15 3:14 
GeneralRe: Difficult to sort : SOLVED!! Pin
PhilLenoir12-Feb-15 3:15
professionalPhilLenoir12-Feb-15 3:15 
GeneralRe: Difficult to sort Pin
BillWoodruff12-Feb-15 3:42
professionalBillWoodruff12-Feb-15 3:42 
Edit Feb. 13, 2015: revised linked-to file referred to here in #2. so it is internally consistent. Included sample object structure to read into by usual file-read techniques.

My solution to a similar quest was:

1.Copy the ordinal table here: [^].

2. massage it into usable form as a data file: [^]. I used the tilde (~) as the in-row item delimiter so integers could be used with commas (as in 10,000), the usual CR/LF as the row delimiter. Could probably use some more massaging.

3. parse the data file into a custom Collection after reading it, filter out what I wanted, then serialize the filtered result it for future use.

The collection can be defined as simply as:
C#
// required
using System.Collections.Generic;

public class OrdinalData : List<OrdinalNumberData>
{
    // removed because the code belongs to a client  
}

// string numberName
// integer number
// string roman numeral
// string ordinal number
// string classifier
// example format: one~1~I~first~1st
public class OrdinalNumberData
{
    public string NumberName { set; get; }
    public int Number { set; get; }
    public string RomanNumeral { set; get; }
    public string OrdinalNumber { set; get; }
    public string Classifier { set; get; }
}

«I'm asked why doesn't C# implement feature X all the time. The answer's always the same: because no one ever designed, specified, implemented, tested, documented, shipped that feature. All six of those things are necessary to make a feature happen. They all cost huge amounts of time, effort and money.» Eric Lippert, Microsoft, 2009

GeneralRe: Difficult to sort Pin
Amarnath S12-Feb-15 3:46
professionalAmarnath S12-Feb-15 3:46 
GeneralRe: Difficult to sort Pin
BillWoodruff12-Feb-15 4:01
professionalBillWoodruff12-Feb-15 4:01 
GeneralRe: Difficult to sort Pin
#realJSOP12-Feb-15 4:29
mve#realJSOP12-Feb-15 4:29 
GeneralRe: Difficult to sort Pin
Kenneth Haugland12-Feb-15 6:30
mvaKenneth Haugland12-Feb-15 6:30 
AnswerRe: Difficult to sort Pin
Mario Majčica12-Feb-15 4:07
professionalMario Majčica12-Feb-15 4:07 
GeneralRe: Difficult to sort Pin
#realJSOP12-Feb-15 4:22
mve#realJSOP12-Feb-15 4:22 
JokeRe: Difficult to sort Pin
Bergholt Stuttley Johnson12-Feb-15 4:54
professionalBergholt Stuttley Johnson12-Feb-15 4:54 
GeneralRe: Difficult to sort Pin
#realJSOP12-Feb-15 5:44
mve#realJSOP12-Feb-15 5:44 
GeneralRe: Difficult to sort Pin
Bergholt Stuttley Johnson12-Feb-15 21:06
professionalBergholt Stuttley Johnson12-Feb-15 21:06 
GeneralRe: Difficult to sort Pin
BillWoodruff12-Feb-15 22:55
professionalBillWoodruff12-Feb-15 22:55 
GeneralRe: Difficult to sort - REAL SOLUTION Pin
#realJSOP12-Feb-15 9:25
mve#realJSOP12-Feb-15 9:25 
GeneralMQOTD Pin
V.11-Feb-15 21:36
professionalV.11-Feb-15 21:36 
GeneralRe: MQOTD Pin
Mendor8111-Feb-15 21:37
professionalMendor8111-Feb-15 21:37 
GeneralRe: MQOTD Pin
HobbyProggy11-Feb-15 21:41
professionalHobbyProggy11-Feb-15 21:41 
GeneralRe: MQOTD Pin
User 1013254611-Feb-15 21:48
User 1013254611-Feb-15 21:48 
GeneralRe: MQOTD Pin
Kenneth Haugland11-Feb-15 22:04
mvaKenneth Haugland11-Feb-15 22:04 
GeneralRe: MQOTD Pin
V.11-Feb-15 22:16
professionalV.11-Feb-15 22:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.