Skip to content

Instantly share code, notes, and snippets.

@toamitkumar
Created November 19, 2012 10:55
Show Gist options
  • Save toamitkumar/4110090 to your computer and use it in GitHub Desktop.
Save toamitkumar/4110090 to your computer and use it in GitHub Desktop.

Revisions

  1. toamitkumar revised this gist Nov 19, 2012. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion gistfile1.m
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,11 @@
    NSDecimal newPoint[2];

    new_point = Pointer.new(NSDecimal.type, 2)

    NSDecimalRound(&newPoint[0], &newPoint[0], 0, NSRoundPlain);

    int x = [[NSDecimalNumber decimalNumberWithDecimal:newPoint[0]] intValue];
    NSDecimalRound(new_point, new_point, 0, NSRoundPlain)

    int x = [[NSDecimalNumber decimalNumberWithDecimal:newPoint[0]] intValue];

    NSDecimalNumber.decimalNumberWithDecimal(new_point[0]).intValue
  2. toamitkumar created this gist Nov 19, 2012.
    5 changes: 5 additions & 0 deletions gistfile1.m
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    NSDecimal newPoint[2];

    NSDecimalRound(&newPoint[0], &newPoint[0], 0, NSRoundPlain);

    int x = [[NSDecimalNumber decimalNumberWithDecimal:newPoint[0]] intValue];