#------------------------------------------------------------
# Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved
# $Id$
#------------------------------------------------------------
package RPS::Locale::Command::FormatNumber;
use strict;
use warnings;

use lib '/app/tools/common/lib';
use RSApache::Command::XMLCommand;
use RSApache::Response::JSON;
use Common::Client;

use base 'RSApache::Command::XMLCommand';

sub cmd  { return 'format_number'; }
sub area { return 'locale'; }

sub execute {
    my ($self) = @_;

    my $response = $self->SUPER::execute();
    return $response if $response;

    my $numberString = $self->getParam("n");

    my $responseNumber = Common::Client::Current()->Locale()->formatNumber($numberString);

    $response = RSApache::Response::JSON->new($responseNumber);

    return $response;
}

1;
