Active IQ Unified Manager Discussions

Doing Concatenation and not addition

Adai

I am using cDOT Resize volume command to resize a volume by specifying a increment size and not the absolute size.

resizeVolume is my Command Variable.

In the other parameters tab, for attribute TargetSize I am having an expression as follows

resizeVolume.size_mb+$IncrementSizeInGB*1024

 

 

The above expresion is getting evalueated as string and getting concatenated and not added as integers.

 

So if my resizeVolume.size_mb is 1024 which is 1GB and my $IncrementSizeInGB is 50GB then the result I get in the execution plan is 

102451200 which is (1024+50*1024) 102551200

 

Am I missing something ? How to get this as addition and not concatenation

 

Regards

adai

1 ACCEPTED SOLUTION

ag
NetApp

This worked for me:

($increment*1024) + (int)resizeVolume.size_mb

 

resizeVolume.size_mb returns a long value and it somehow gets concatenated.

 

Let me know if it works.

 

-Anil

 

View solution in original post

5 REPLIES 5

Adai

Hi Anil and Parag,

Thanks for your quick replies, both your solution works.

 

Regards

adai

ag
NetApp

This worked for me:

($increment*1024) + (int)resizeVolume.size_mb

 

resizeVolume.size_mb returns a long value and it somehow gets concatenated.

 

Let me know if it works.

 

-Anil

 

View solution in original post

AdaikkappanArumugam

Hi WFA Team,

Is this bug fixed in WFA 3.0 GA or atleast in 3.1 RC thats coming soon ?

 

Regards

Adai

paragp

Adai, I am checking to see if this is a bug. In the meanwhile you can use this expression to make sure the numbers get added instead of concatenated.

 

Long.valueOf(resizeVolume.size_mb)+$IncrementSizeInGB*1024

 

trentino123

Here is an example of resize function ( check for the (int) when returning a result so it does not concatenate as a string ) :

 

def setNewVolSize(growVolume, addSize, rateOfChange) {
  if (addSize=='')
     return growVolume.size_mb;
  else
     return ((int) growVolume.size_mb) + calculateVolumeSizeFromDataSize(convertFromGB(addSize),rateOfChange);
}

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public